Skip to content

Conversation

@davidhicks980
Copy link
Contributor

Fixes #119532

Also, adds a few features from https://www.w3.org/WAI/ARIA/apg/patterns/menubar/:

  • Adds two actions to vertically-opening menu anchors (in other words, submenus that open below or above their anchor button) that allow upward and downward directional focus navigation into the menu panel (Allow MenuAnchor created menus to traverse the submenu via keyboard. #119532).
  • Adds [Home] and [End] key shortcuts/actions to the menu overlay
    • [Home] moves to the first menu item
    • [End] moves to the last menu item
  • Adds focus wrapping to the Submenu widget (but not the MenuAnchor widget) for non-apple platforms.
  • Splits the submenu focus handling action into a submenu button action and a submenu overlay action
  • Adds an overlayActions parameter to MenuAnchor to allow users to override the overlay actions.

This is a breaking change since it adds focus wrapping.

I'm open to suggestions regarding whether to add or remove more customizability to the menu shortcuts and actions. As mentioned, I'm not currently wrapping focus on the MenuAnchor but am wrapping focus on the SubmenuButton. This is because I didn't want to break existing submenus that are built atop MenuAnchor.

TODO: Migration guide.

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

@github-actions github-actions bot added framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow MenuAnchor created menus to traverse the submenu via keyboard.

1 participant