Skip to content

[material_ui] DrawerButton and NavigationRail omit Semantics states #194904

Closed
flutter/packages
#13176

Description

@kevmoo

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):

  1. DrawerButtonIcon & EndDrawerButtonIcon missing expanded semantics (b/460308840, b/461982793): action_buttons.dart#L288-L367 builds the drawer action icon without setting Semantics.expanded from ScaffoldState.isDrawerOpen / isEndDrawerOpen, omitting SemanticsFlag.isExpanded on /drawer and /navigation-drawer.
  2. NavigationRail destinations missing tabBar / tab roles: navigation_rail.dart#L520-L553 and navigation_rail.dart#L961-L985 omit SemanticsRole.tabBar on the destination group and SemanticsRole.tab on _RailDestination (unlike TabBar and Tab in tabs.dart), exposing destinations as generic buttons instead of tabs and duplicating the "Tab i of n" indexLabel on web where SemanticsRole.tabBar (role="tablist") already exposes set size.

Proposed Fix

  • Set Semantics(expanded: ...) on DrawerButtonIcon and EndDrawerButtonIcon when an ancestor Scaffold has a drawer or endDrawer (flutter/packages#13176).
  • Assign SemanticsRole.tabBar to NavigationRail's destination group and SemanticsRole.tab (with MergeSemantics and non-web indexLabel, matching TabBar/Tab) to _RailDestination (flutter/packages#13176).
Reproduction steps & semantics inspection (AI-assisted)
  1. Inspect the SemanticsNode tree for DrawerButton / EndDrawerButton inside a Scaffold with a drawer / endDrawer, and for NavigationRail (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

Activity

  1. added
    in triagePresently being triaged by the triage team
    p: material_uimaterial_ui package in flutter/packages
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    packageflutter/packages repository. See also p: labels.
    fyi-designFor the attention of Design Languages team
    team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)
    and removed
    in triagePresently being triaged by the triage team
    on Oct 21, 2026
  2. added
    P2Important issues not at the top of the work list
    on Oct 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)p: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-accessibilityOwned by Framework Accessibility team (i.e. responsible for accessibility code in flutter/flutter)triaged-accessibilityTriaged by Framework Accessibility team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions