[a11y] remove the deprecated focusable flag in Focus widget. #173880
[a11y] remove the deprecated focusable flag in Focus widget. #173880hannah-hyj wants to merge 1 commit intoflutter:masterfrom
focusable flag in Focus widget. #173880Conversation
There was a problem hiding this comment.
Code Review
This pull request removes the deprecated focusable property from the Focus widget's Semantics child. This change simplifies the semantics tree by removing an intermediate node in some cases, which is the intended effect. The test files have been updated accordingly to reflect these changes in the semantics tree.
My main feedback is a suggestion to improve the clarity of a test name in shortcuts_test.dart to better reflect its updated behavior. Otherwise, the changes look good.
| testWidgets('Shortcuts does not insert a semantics node when includeSemantics is false', ( | ||
| WidgetTester tester, | ||
| ) async { | ||
| testWidgets('Shortcuts does not insert a semantics', (WidgetTester tester) async { |
There was a problem hiding this comment.
The new test name is a bit ambiguous. Since the test now verifies that Shortcuts doesn't insert a semantics node regardless of the includeSemantics value, a more descriptive name would improve clarity for future readers. How about something like 'Shortcuts widget does not insert a semantics node'?
testWidgets('Shortcuts widget does not insert a semantics node', (WidgetTester tester) async {
8e79cdc to
82a6f43
Compare
Update focus_scope.dart 1 Co-Authored-By: chunhtai <[email protected]>
59a5a87 to
7c17e4a
Compare
This is a follow-up to #170935.
Noticed when in some cases Semantics(focusable: false, focused: false) becomes Semantics(focused: null). Although they are the same in flag values. However, the first one is annotated in the semantics tree, while the second one is not. This difference can sometimes cause the tree structure to change.
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
List which issues are fixed by this PR. You must list at least one issue. An issue is not required if the PR fixes something trivial like a typo.
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.