User focus is lost when exiting Account Menu (Accessibility) #6635
Labels
Exp: SP
Good First Issue
Good first issue for new engineers
P1
Medium priority
Type: Bug
Something isn't working
Bug Description
After exiting the Account Menu (using the Escape key), no element on the screen is focused and the user must press Tab or Shift + Tab to get an element on the page to appear focused.
Steps to reproduce
Screenshots
Focus.lost.when.exiting.Account.Menu.mp4
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Implementation Brief
assets/js/components/UserMenu/index.js
menuButtonRef
const that serves as a ref for the Button usinguseRef()
menuButtonRef
as a ref to the<Button>
handleMenu
callback, set the focus to the button whenmenuOpen
is false.menuButtonRef.current?.focus();
site-kit-wp/assets/js/components/UserMenu/index.js
Lines 100 to 106 in ce3938d
Test Coverage
QA Brief
Space
orEnter
).Escape
key.Space
orEnter
).The below GIF indicates what a successfully functioning version of the above may look like:
Changelog entry
The text was updated successfully, but these errors were encountered: