Skip to content

[VPAT] Expose modal drawers with the dialog semantics role - #13660

Merged
auto-submit[bot] merged 2 commits into
flutter:mainfrom
flutter-zl:material-ui-modal-drawer-dialog-role
Nov 19, 2026
Merged

auto-submit[bot] merged 2 commits into
flutter:mainfrom
flutter-zl:material-ui-modal-drawer-dialog-role

Conversation

@flutter-zl

@flutter-zl flutter-zl commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Fixes flutter/flutter#196565

Problem

A Drawer opened from Scaffold.drawer or endDrawer is modal: DrawerController blocks the page behind it from semantics and Tab stays inside it. But its Semantics has no role, so on web screen readers are not told it is a dialog:

  • On Windows, Linux and Android browsers it renders as role="region" with aria-label="Navigation menu" and no aria-modal.
  • On macOS and iOS browsers it renders with no role and an empty aria-label, because Drawer skips its default label on Apple platforms and the web engine only adds role="region" for a labeled route.

Fix

  1. Drawer sets role: SemanticsRole.dialog on its existing route Semantics when it is shown by a DrawerController. The web engine already maps that role to role="dialog" with aria-modal="true", as it does for Dialog. A Drawer placed directly in a layout keeps no role.
  2. On the web, Drawer always applies its default label, MaterialLocalizations.drawerLabel, so the dialog has an accessible name on every OS. Native iOS and macOS keep skipping it: that rule came from #16081, where the label is a route announcement and native iOS does not announce a drawer, but on the web the same label is also the accessible name.

Demo

Before: https://flutter-demo-100-before.web.app/#/drawer
After: https://flutter-demo-100-after.web.app/#/drawer

Open the drawer with the menu button at the top right, then inspect it in DevTools or listen with a screen reader. Before: no dialog role, and on a Mac no name. After: role="dialog" aria-modal="true" aria-label="Navigation menu" on every OS. #/navigation-drawer shows the same difference.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Nov 13, 2026
@github-actions github-actions Bot added p: material_ui triage-design Should be looked at in design triage labels Nov 13, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request updates the 'Drawer' widget to assign the 'SemanticsRole.dialog' role when it is displayed within a 'DrawerController'. It includes new tests to verify the semantics role of 'Drawer' and 'NavigationDrawer' when opened by a 'Scaffold', as well as when a 'Drawer' is used outside of a 'DrawerController'. A pending changelog entry has also been added. There are no review comments, and I have no feedback to provide.

@github-actions github-actions Bot added the P1 High-priority issues at the top of the work list label Nov 13, 2026
@flutter-zl flutter-zl changed the title [material_ui] Expose modal drawers with the dialog semantics role [VPAT] Expose modal drawers with the dialog semantics role Nov 14, 2026

@hannah-hyj hannah-hyj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@flutter-zl flutter-zl added the autosubmit Merge PR when tree becomes green via auto submit App label Nov 19, 2026
@auto-submit
auto-submit Bot merged commit e6cb01a into flutter:main Nov 19, 2026
17 checks passed
opensource-fork-sync Bot pushed a commit to cla7aye15I4nd/opensource-flutter__flutter that referenced this pull request Nov 20, 2026
…er#197056)

flutter/packages@81b7c44...898818d

2026-11-20 [email protected] [material_ui] Use correct time format for
Sinhala locale (flutter/packages#13645)
2026-11-20 [email protected] [material_ui]
Fix showModalBottomSheet safe area on display-feature sub-screens
(flutter/packages#13428)
2026-11-20 [email protected] [material_ui]
Fix M3 doc errors in the `ElevatedButton` and `FilledButton`
(flutter/packages#13685)
2026-11-19 [email protected] [video_player] Convert implementation
to Kotlin (flutter/packages#13683)
2026-11-19 [email protected] [flutter_svg] Add
SvgLoader.provideSvgInIsolate for unsendable loaders
(flutter/packages#13598)
2026-11-19 [email protected] [VPAT] Expose modal drawers with the
dialog semantics role (flutter/packages#13660)
2026-11-19 [email protected] [VPAT] Keep a11y_assessments tooltips
open while hovered (flutter/packages#13657)
2026-11-19 [email protected] [flutter_svg] Stabilize network SVG cache
keys (flutter/packages#13597)
2026-11-19 [email protected]
[image_picker_ios] Return an error instead of an empty file when an
image cannot be saved (flutter/packages#12998)
2026-11-19 [email protected] [cupertino_ui]
Fix CupertinoNavigationBarBackButton assertion debug
(flutter/packages#13397)
2026-11-19 [email protected] [go_router] Document when
GoRouterState.name and path are null (flutter/packages#13486)

If this roll has caused a breakage, revert this CL and set the roller
to dry run mode using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC [email protected] on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: material_ui P1 High-priority issues at the top of the work list triage-design Should be looked at in design triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[material_ui] Modal Drawer is announced as a region instead of a dialog

2 participants