A11y Bug 6210968: Keyboard focus gets lost after closing the 'location dropdown' control via esc key.#643
Open
KethanaReddy7 wants to merge 3 commits intouser/kpeddireddy/LocationButtonTabfrom
Conversation
…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 <KethanaReddy7@users.noreply.github.com>
Author
|
@claude on entering escape from the dropdown list the focus is escaping somewhere but it should land on location dropdown as shown in image |
|
Claude finished @KethanaReddy7's task in 3m 14s —— View job Fixed Focus Issue
Root Cause: The focus was being set immediately during the Fix: Wrapped the focus call in Changes:
|
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 <KethanaReddy7@users.noreply.github.com>
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.

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