You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6dfa8bf
Browse filesBrowse the repository at this point in the historyBrowse files
[web] Omit group role on menu scrollables and assign region role to named routes (flutter#192965)
## Description
Fixes two web accessibility ARIA role issues in `lib/web_ui`:
1. **VoiceOver item count off-by-one in `PopupMenuButton`, `MenuAnchor`,
and `DropdownButton` (`flutter#190661`)**: When a menu renders on the web, its
items are wrapped in an intermediate `SingleChildScrollView`
(`SemanticScrollable`, which sets `role="group"` in its constructor)
while `SemanticMenu` / `SemanticMenuBar` sets `aria-owns` directly to
the descendant `menuItem` nodes. Leaving `role="group"` on the unlabeled
intermediate scrollable causes WebKit/VoiceOver to count the scrollable
container as child `1` alongside the `N` `aria-owns` `menuitem`s
(`"menu, N+1 items"`, announcing item 1 as `"2 of N+1"`). Setting
`role="none"` on unlabeled intermediate `SemanticScrollable` containers
inside `SemanticMenu` and `SemanticMenuBar` eliminates the off-by-one
item count while preserving DOM scroll behavior.
2. **Valid ARIA role for self-labeled `SemanticRoute`
(`aria-prohibited-attr`, http://b/462008723, http://b/461982793,
http://b/460641753)**: When `SemanticRoute` has `namesRoute: true`
(setting `aria-label` on `<flt-semantics>`), it previously omitted the
`role` attribute (`role="generic"`), violating WAI-ARIA 1.2
`aria-prohibited-attr` (`aria-label` is prohibited on generic elements).
`SemanticRoute.update()` now sets `role="region"` when
`semanticsObject.namesRoute` is true.
Fixesflutter#190661
Fixes http://b/462008723
Fixes http://b/461982793
Fixes http://b/460641753
## 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 and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [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] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.
0 commit comments