Skip to content

A11y Bug 6210624: Keyboard focus does not land over the selected item after expanding the "location dropdown" using keyboard.#648

Merged
KethanaReddy7 merged 4 commits intouser/kpeddireddy/LocationButtonTabfrom
claude/issue-640-20260312-1031
Mar 26, 2026
Merged

A11y Bug 6210624: Keyboard focus does not land over the selected item after expanding the "location dropdown" using keyboard.#648
KethanaReddy7 merged 4 commits intouser/kpeddireddy/LocationButtonTabfrom
claude/issue-640-20260312-1031

Conversation

@KethanaReddy7
Copy link
Copy Markdown

@KethanaReddy7 KethanaReddy7 commented Mar 23, 2026

When the location dropdown is expanded using keyboard, focus should move to the dropdown list automatically when we hit enter. This improves keyboard accessibility by ensuring users can immediately identify which item is selected.

The fix adds focus management to the onPopupToggle handler that:

Falls back to focusing the first focusable item in the list
Demo
https://github.com/user-attachments/assets/aa5fc10b-28ca-46e1-8d62-ebeef9326953

Fixes #640

github-actions bot and others added 4 commits March 12, 2026 10:34
…yboard

When the location dropdown is expanded using keyboard (Tab + Enter),
focus should automatically move to the currently selected section.
This improves keyboard accessibility by ensuring users can immediately
identify which item is selected.

The fix adds focus management to the onPopupToggle handler that:
- Focuses on the selected section using aria-selected, data-id, or id
- Falls back to focusing the first focusable item if no selection exists

Fixes #640

Co-authored-by: KethanaReddy7 <KethanaReddy7@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…focus

Replace requestAnimationFrame with setTimeout(100ms) to ensure the
OneNotePickerComponent popup is fully rendered before attempting to
focus on the selected item. requestAnimationFrame alone may fire before
the external component has finished rendering its interactive elements.

Co-authored-by: KethanaReddy7 <KethanaReddy7@users.noreply.github.com>
@KethanaReddy7 KethanaReddy7 changed the base branch from master to user/kpeddireddy/LocationButtonTab March 23, 2026 07:27
Copy link
Copy Markdown
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

@KethanaReddy7 KethanaReddy7 merged commit 0004236 into user/kpeddireddy/LocationButtonTab Mar 26, 2026
4 checks passed
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 6210624: Keyboard focus does not land over the selected item after expanding the "location dropdown" using keyboard.

2 participants