Skip to content

A11y Bug 6210968: Keyboard focus gets lost after closing the 'location dropdown' control via esc key#650

Open
KethanaReddy7 wants to merge 3 commits intouser/kpeddireddy/LocationButtonTabfrom
claude/issue-641-20260312-1033
Open

A11y Bug 6210968: Keyboard focus gets lost after closing the 'location dropdown' control via esc key#650
KethanaReddy7 wants to merge 3 commits intouser/kpeddireddy/LocationButtonTabfrom
claude/issue-641-20260312-1033

Conversation

@KethanaReddy7
Copy link

@KethanaReddy7 KethanaReddy7 commented Mar 23, 2026

When the location dropdown was closed via the Escape key, keyboard focus was lost, making it difficult for keyboard-only users to continue navigating. This fix ensures focus returns to the dropdown trigger element when the popup closes, improving accessibility for keyboard users.

Demo
https://github.com/user-attachments/assets/ac836069-451d-4d8d-a1c5-cd2de19b05b9

Fixes #641

github-actions bot and others added 3 commits March 12, 2026 10:36
…cape key

When the location dropdown was closed via the Escape key, keyboard focus was
lost, making it difficult for keyboard-only users to continue navigating.
This fix ensures focus returns to the dropdown trigger element when the popup
closes, improving accessibility for keyboard users.

Fixes #641

Co-authored-by: KethanaReddy7 <[email protected]>
The focus was being lost because it was set immediately during the
onPopupToggle callback, but the OneNotePicker component's internal
DOM manipulation was happening after the focus call. By using
setTimeout(0), the focus is now deferred until after the event loop
allows the DOM to stabilize.

Co-authored-by: KethanaReddy7 <[email protected]>
@KethanaReddy7 KethanaReddy7 changed the base branch from master to user/kpeddireddy/LocationButtonTab March 23, 2026 07:30
@KethanaReddy7 KethanaReddy7 changed the title fix: restore keyboard focus to location dropdown after closing via Escape key A11y Bug 6210968: Keyboard focus gets lost after closing the 'location dropdown' control via esc key Mar 23, 2026
Copy link
Contributor

@aanchalbhansali aanchalbhansali left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A11y Bug 6210968: Keyboard focus gets lost after closing the 'location dropdown' control via esc key.

2 participants