Repository navigation
Closed
flutter/packages
#13176Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)Owned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility teamTriaged by Framework Accessibility team
Description
In packages/material_ui, assistive technologies across platforms (TalkBack, VoiceOver, NVDA, JAWS) are not informed of drawer expand/collapse state on DrawerButton and EndDrawerButton or tab selection roles on NavigationRail destinations (WCAG 4.1.2 Name, Role, Value):
DrawerButtonIcon&EndDrawerButtonIconmissingexpandedsemantics (b/460308840,b/461982793):action_buttons.dart#L288-L367builds the drawer action icon without settingSemantics.expandedfromScaffoldState.isDrawerOpen/isEndDrawerOpen, omittingSemanticsFlag.isExpandedon/drawerand/navigation-drawer.NavigationRaildestinations missingtabBar/tabroles:navigation_rail.dart#L520-L553andnavigation_rail.dart#L961-L985omitSemanticsRole.tabBaron the destination group andSemanticsRole.tabon_RailDestination(unlikeTabBarandTabintabs.dart), exposing destinations as generic buttons instead of tabs and duplicating the"Tab i of n"indexLabelon web whereSemanticsRole.tabBar(role="tablist") already exposes set size.
Proposed Fix
- Set
Semantics(expanded: ...)onDrawerButtonIconandEndDrawerButtonIconwhen an ancestorScaffoldhas adrawerorendDrawer(flutter/packages#13176). - Assign
SemanticsRole.tabBartoNavigationRail's destination group andSemanticsRole.tab(withMergeSemanticsand non-webindexLabel, matchingTabBar/Tab) to_RailDestination(flutter/packages#13176).
Reproduction steps & semantics inspection (AI-assisted)
- Inspect the
SemanticsNodetree forDrawerButton/EndDrawerButtoninside aScaffoldwith adrawer/endDrawer, and forNavigationRail(82c9ad5e618b6142e33dd1c583ee65f51deaa888):
# DrawerButton / EndDrawerButton before fix:
SemanticsData(flags: [isButton, isEnabled, isFocusable], label: "Open navigation menu")
# Missing: isExpanded (true when drawer is open, false when closed)
# NavigationRail & _RailDestination before fix:
SemanticsData(role: SemanticsRole.none, flags: [isSelected, isButton, isFocusable], label: "First\nTab 1 of 3")
# Expected: parent SemanticsRole.tabBar + child SemanticsRole.tab
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)Accessibility, e.g. VoiceOver or TalkBack. (aka a11y)p: material_uimaterial_ui package in flutter/packagesmaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)Owned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility teamTriaged by Framework Accessibility team
Activity
[material_ui] Add tabBar/tab roles and expanded state semantics (flut…