[go: nahoru, domu]

Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
labeledTapTargetGuideline should passe if textfield does not have lab…
Browse files Browse the repository at this point in the history
…el (#116221)
  • Loading branch information
chunhtai committed Nov 30, 2022
1 parent 9532b91 commit 6b98f2c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/flutter_test/lib/src/accessibility.dart
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,8 @@ class LabeledTapTargetGuideline extends AccessibilityGuideline {
});
if (node.isMergedIntoParent ||
node.isInvisible ||
node.hasFlag(ui.SemanticsFlag.isHidden)) {
node.hasFlag(ui.SemanticsFlag.isHidden) ||
node.hasFlag(ui.SemanticsFlag.isTextField)) {
return result;
}
final SemanticsData data = node.getSemanticsData();
Expand Down
8 changes: 8 additions & 0 deletions packages/flutter_test/test/accessibility_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,14 @@ void main() {
expect(result.passed, true);
handle.dispose();
});

testWidgets('Passes if text field does not have label', (WidgetTester tester) async {
final SemanticsHandle handle = tester.ensureSemantics();
await tester.pumpWidget(_boilerplate(const TextField()));
final Evaluation result = await labeledTapTargetGuideline.evaluate(tester);
expect(result.passed, true);
handle.dispose();
});
});

testWidgets('regression test for material widget',
Expand Down

0 comments on commit 6b98f2c

Please sign in to comment.