Fix: Keyboard focus does not land on selected item when opening location dropdown#653
Draft
Fix: Keyboard focus does not land on selected item when opening location dropdown#653
Conversation
Agent-Logs-Url: https://github.com/OneNoteDev/WebClipper/sessions/a4bc18dd-5306-49f5-accf-24b9644af25c Co-authored-by: KethanaReddy7 <257986085+KethanaReddy7@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix keyboard focus issue in location dropdown
Fix: Keyboard focus does not land on selected item when opening location dropdown
Mar 31, 2026
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 is expanded via keyboard, focus remains on the trigger button instead of moving to the currently selected section item, leaving keyboard users unable to identify where focus is.
Changes
sectionPicker.tsx—onPopupToggle: When the popup opens, schedules asetTimeout(0)callback (to allow DOM render) that focuses the currently selected section element bycurSectionId. Falls back to the first keyboard-navigable item in#sectionPickerContainerif no selected element is found.The fallback selector
[tabindex]:not([tabindex="-1"])intentionally excludes programmatically-only focusable elements, ensuring only keyboard-reachable items receive focus.sectionPicker_tests.tsx: Added 3 tests using sinon fake timers covering: focus on selected section when popup opens, fallback focus to first item when no section selected, and no focus change when popup closes.Original prompt
Work item: AB#6210624
Created via Azure DevOps