Wire up MenuAnchor, MenuBar, MenuItem-related widgets to aria roles#165596
Wire up MenuAnchor, MenuBar, MenuItem-related widgets to aria roles#165596auto-submit[bot] merged 17 commits intoflutter:masterfrom
MenuAnchor, MenuBar, MenuItem-related widgets to aria roles#165596Conversation
|
Once #164439 land, tests will be fixed. |
9b73d1f to
74d845f
Compare
Flutter PR flutter/flutter#165596 (wiring up MenuAnchor-related widgets to SemanticsRole) breaks this test; fix it by adding the needed Semantics wrappers. Co-authored-by: Chris Bobbe <[email protected]>
|
Created zulip/zulip-flutter#1443 to fix customer testing. |
Flutter PR flutter/flutter#165596 (wiring up MenuAnchor-related widgets to SemanticsRole) breaks this test; fix it by adding the needed Semantics wrappers. Co-authored-by: Chris Bobbe <[email protected]>
e2a509e to
f8a9f49
Compare
This is to fix the customer testing in flutter/flutter#165596 by picking up zulip/zulip-flutter#1443 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read the [Flutter Style Guide] _recently_, and have followed its advice. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] All existing and new tests are passing.
f8a9f49 to
ae30e5b
Compare
| @@ -1 +1 @@ | |||
| 3566ea0e688123cecc2b605bda13732adc1e610a | |||
| 8be72094d9b33dae8ff8a7085a3d922e7b3cad47 | |||
There was a problem hiding this comment.
This is intended to fix the customer testing.
|
|
||
| static FlutterError? _semanticsMenu(SemanticsNode node) { | ||
| if (node.childrenCount < 1) { | ||
| return FlutterError('a menu cannot be empty'); |
There was a problem hiding this comment.
I think a menu can be empty if we have filter behavior, so I removed this check.
|
|
||
| @override | ||
| Widget buildAnchor(BuildContext context) { | ||
| final Widget? overlayPortal = |
There was a problem hiding this comment.
We want the menu button and the menu have a parent-children relationship, but for OverlayPortal, its child and overlayChildBuilder are siblings relationship. To construct parent-children relationship, we use RawMenuAnchor.builder as the parent to wrap OverlayPortal which is constructed by RawMenuAnchor.child and RawMenuAnchor.overlayBuilder.
The disadvantage for this change is, if either widget.child or widget.builder is null, we are not able to have the parent-children relationship, but SubmenuButton is implemented by using both, so it should be okay.
|
Breaking change page: flutter/website#11881 |
This PR is to wire up
MenuAnchorrelated widgets to SemanticsRole.MenuAnchorand a menu is opened, the menu hasSemanticsRole.menu.MenuBarhasSemanticsRole.menuBarMenuItemButtonhasSemanticsRole.menuItemSubmenuButtonhasSemanticsRole.menuItemwitharia-haspopupattribute setup.CheckboxMenuButtonhasSemanticsRole.menuItemCheckboxRadioMenuButtonhasSemanticsRole.menuItemRadioThis PR also includes some changes related to
OverlayPortalandRawMenuAnchorso the "button" and the "menu" that the button opens has a "parent-children" relationship. Previously, they are siblings relationship which will cause some navigation issue in a11y.Pre-launch Checklist
///).