-
Notifications
You must be signed in to change notification settings - Fork 645
Description
Description
When converting the tests for ActionMenu to vitest (#6383) an issue with the focus management of ActionMenu was discovered. The tests assert that, when opening the menu w/ a click, the button should remain focused and arrow-down should highlight the first item in the list.
However, in storybook (and vitest) the first item to be highlighted after opening the menu is the second item in the list. (see video)
CleanShot.2025-08-01.at.10.27.00.mp4
The menu works as expected when it is opened via the keyboard.
I suspect this is due to a the focus-lock management auto-advancing the focus into the menu prior to the arrow keys being clicked; thus when the arrow-key is pressed it advances to the second item in the list.
When fixing this, the tests skipped in #6435 should be re-enabled as well.
Steps to reproduce
- Go to the ActionMenu story in storybook
- Click on the Menu
- Click down-arrow
- Observe that the first highlighted item is the second in the list
Version
v37.30
Browser
Chrome