From aeb12144e66698bceccd867b57b197339cdfdf42 Mon Sep 17 00:00:00 2001 From: Anthony <591699+clocksmith@users.noreply.github.com> Date: Wed, 15 Jan 2020 19:38:04 -0500 Subject: [PATCH] Use a separately focusable semantics node for the chip delete icon (#48740) --- packages/flutter/lib/src/material/chip.dart | 26 ++++++----- packages/flutter/test/material/chip_test.dart | 44 +++++++++++++++++++ 2 files changed, 59 insertions(+), 11 deletions(-) diff --git a/packages/flutter/lib/src/material/chip.dart b/packages/flutter/lib/src/material/chip.dart index 96cf9ad2bc..cdcb0d4c6f 100644 --- a/packages/flutter/lib/src/material/chip.dart +++ b/packages/flutter/lib/src/material/chip.dart @@ -1784,23 +1784,27 @@ class _RawChipState extends State with TickerProviderStateMixin[ + TestSemantics( + textDirection: TextDirection.ltr, + children: [ + TestSemantics( + flags: [SemanticsFlag.scopesRoute], + children: [ + TestSemantics( + label: 'test', + textDirection: TextDirection.ltr, + children: [ + TestSemantics( + label: 'Delete', + actions: [SemanticsAction.tap], + textDirection: TextDirection.ltr, + flags: [ + SemanticsFlag.isButton, + ], + ), + ], + ), + ], + ), + ], + ), + ], + ), ignoreTransform: true, ignoreId: true, ignoreRect: true)); + semanticsTester.dispose(); + }); + testWidgets('with onPressed', (WidgetTester tester) async { final SemanticsTester semanticsTester = SemanticsTester(tester);