Skip to content

Re-Land: Add focus nodes, hover, and shortcuts to switches, checkboxes, and radio buttons.#43384

Merged
gspencergoog merged 2 commits intoflutter:masterfrom
gspencergoog:switch_focus
Oct 28, 2019
Merged

Re-Land: Add focus nodes, hover, and shortcuts to switches, checkboxes, and radio buttons.#43384
gspencergoog merged 2 commits intoflutter:masterfrom
gspencergoog:switch_focus

Conversation

@gspencergoog
Copy link
Contributor

Description

This re-lands the change that adds focus nodes, hover, and shortcuts to switches, checkboxes, and radio buttons. (#43213)

No changes from original, except for finding the right RenderBox in dev/integration_tests/android_semantics_testing/test_driver/main_test.dart.

Breaking Change

  • No, this is not a breaking change.

@fluttergithubbot fluttergithubbot added a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Oct 23, 2019
Copy link
Contributor

@darrenaustin darrenaustin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a lot here, and I might have missed something, but this LGTM.

return getSemantics(
find.descendant(
of: find.byValueKey(key),
matching: find.byType('_CheckboxRenderObjectWidget'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this need to be against _CheckboxRenderObjectWidget and not just the key?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the key corresponds to a RenderMouseRegion now that I've added the MouseRegion, so we have to dig down to find the render object for the checkbox which adds the semantics.

));

expect(tester.getSemantics(find.byType(Checkbox)), matchesSemantics(
expect(tester.getSemantics(find.byType(Focus)), matchesSemantics(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change from Checkbox to Focus here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because that gets us down past the RenderMouseRegion so that it gets the _CheckboxRenderObjectWidget render object to query semantics from. Since Focus doesn't have a render object associated with it, it defers to the _CheckboxRenderObjectWidget.

@gspencergoog gspencergoog merged commit 8017f63 into flutter:master Oct 28, 2019
@yjbanov
Copy link
Contributor

yjbanov commented Oct 28, 2019

This PR seems to have broken web tests on master.

gspencergoog added a commit to gspencergoog/flutter that referenced this pull request Oct 28, 2019
…heckboxes, and radio buttons. (flutter#43384)"

This reverts commit 8017f63, since it breaks web tests.
gspencergoog added a commit that referenced this pull request Oct 28, 2019
…heckboxes, and radio buttons. (#43384)" (#43647)

This reverts commit 8017f63, since it breaks web tests.
gspencergoog added a commit to gspencergoog/flutter that referenced this pull request Oct 28, 2019
…s, and radio buttons. (flutter#43384)

This reverts commit 38f2d27 to fix web tests.
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
…s, and radio buttons. (flutter#43384)

This re-lands the change that adds focus nodes, hover, and shortcuts to switches, checkboxes, and radio buttons. (flutter#43213)

No changes from original, except for finding the right RenderBox in dev/integration_tests/android_semantics_testing/test_driver/main_test.dart.
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
…heckboxes, and radio buttons. (flutter#43384)" (flutter#43647)

This reverts commit 8017f63, since it breaks web tests.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 3, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) c: contributor-productivity Team-specific productivity, code health, technical debt. f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants