Repository navigation
fix(aria/menu): activate interactive content inside menu items - #34093
Open
sandeep780049 wants to merge 1 commit into
Open
sandeep780049 wants to merge 1 commit into
sandeep780049 wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
sandeep780049
force-pushed
the
fix/menu-enter-activates-interactive-content
branch
from
November 7, 2026 06:39
7f6dbb4 to
95a2b96
Compare
Author
|
@google-cla I signed it! |
Menu items can wrap native interactive elements such as links and buttons, but Enter and Space only ran the menu selection logic, so the wrapped element was never activated and link items were effectively mouse-only. `MenuItemPattern` now resolves the interactive element rendered inside the item and clicks it when the item is triggered, which bubbles up to the menu's click handler and selects the item exactly like a mouse click does. Items that don't wrap interactive content keep the previous behavior, and menu bar items open their submenu first, as before. Fixes angular#34072.
sandeep780049
force-pushed
the
fix/menu-enter-activates-interactive-content
branch
from
November 7, 2026 06:56
95a2b96 to
f2d9330
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Menu items can wrap native interactive elements (a link, a button, an input), but
Enter/Spaceonly ran the menu's selection logic. The wrapped element was neveractivated, so link items and items with
(click)handlers inside the content wereeffectively mouse-only.
MenuItemPatternnow resolves the interactive element rendered inside the item andclicks it when the item is triggered. The click bubbles up to the menu's existing
clickhandler, so the item is still selected exactly as it is on a mouse click —keyboard and mouse now behave the same. Items without interactive content keep their
current behavior, and menu bar items still open their submenu first.
Fixes #34072.
Testing
src/aria/menu/menu.spec.tsfor a menu whose items wrap alink, a button, and no interactive content at all, asserting that
EnterandSpaceactivate the inner element and still report the selection.src/aria/private/menu/menu.tsandsrc/aria/menu/menu.spec.ts) passes.bazel test //src/aria/menu:unit_testscould not be run on my machine becauseBazel fails to resolve the
rules_sasstoolchain on Windows, unrelated to this change.