Description
A closed ActionMenu can open when its invoker has focus and the user presses a single-character key, including modified browser shortcuts such as Command+R or Control+R and characters that do not match any item mnemonic.
Steps to reproduce
- Render a single-select
ActionMenu.
- Focus its invoker while the menu is closed. Selecting an item first is one way to return focus to the invoker.
- Press Command+R, Control+R, or a single-character key that does not match an item.
Expected behavior
- Modified shortcuts do not open the menu.
- An unmatched mnemonic does not open the menu or focus an item.
- An unmodified matching mnemonic continues to open the menu and focus the matching item.
Actual behavior
The menu opens before the shortcut or keypress completes. When no mnemonic matches, focus moves to the last item.
Environment
Reproduced with Primer ViewComponents v0.53.1 and current main.
Acceptance criteria
- Control-, Command-, and Alt-modified character keypresses do not trigger mnemonic handling.
- Unmatched character keypresses leave a closed menu closed.
- Matching unmodified mnemonic behavior remains unchanged.
Description
A closed
ActionMenucan open when its invoker has focus and the user presses a single-character key, including modified browser shortcuts such as Command+R or Control+R and characters that do not match any item mnemonic.Steps to reproduce
ActionMenu.Expected behavior
Actual behavior
The menu opens before the shortcut or keypress completes. When no mnemonic matches, focus moves to the last item.
Environment
Reproduced with Primer ViewComponents v0.53.1 and current
main.Acceptance criteria