Skip to content

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

Open
KethanaReddy7 wants to merge 4 commits intouser/kpeddireddy/LocationButtonTabfrom
claude/issue-640-20260312-1031
Open

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

Conversation

@KethanaReddy7
Copy link

@KethanaReddy7 KethanaReddy7 commented Mar 17, 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

…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>
@KethanaReddy7
Copy link
Author

@claude the problem is that when focus lands on location dropdown and on hitting enter the focus is not landing on the list, so on hitting enter the focus should go into the dropdown list

@claude
Copy link

claude bot commented Mar 18, 2026

Claude finished @KethanaReddy7's task in 2m 23s —— View job


Fix Applied

  • Read and understand the current implementation
  • Identify why focus isn't landing on the dropdown list
  • Implement the fix
  • Commit and push the changes

Issue: The original code used requestAnimationFrame to wait for the popup to render before focusing. However, requestAnimationFrame only waits for one frame, which may not be enough time for the external OneNotePickerComponent to fully render the popup and its interactive elements.

Fix: Replaced requestAnimationFrame with setTimeout(..., 100) to give the popup sufficient time to fully render before attempting to focus on elements within it.

Changes made:

  • src/scripts/clipperUI/components/sectionPicker.tsx: Changed timing mechanism from requestAnimationFrame to setTimeout with 100ms delay

Commit: de64190
|

…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 title A11y Bug 6210624: Keyboard focus does not land over the selected item after expanding the "location dropdown" using keyboard A11y Bug 6210624, 6210968: Fix keyboard focus for Location dropdown list on enter and escape Mar 18, 2026
@KethanaReddy7 KethanaReddy7 changed the title A11y Bug 6210624, 6210968: Fix keyboard focus for Location dropdown list on enter and escape A11y Bug 6210624: Keyboard focus does not land over the selected item after expanding the "location dropdown" using keyboard. Mar 18, 2026
@KethanaReddy7 KethanaReddy7 force-pushed the claude/issue-640-20260312-1031 branch from 87e76bf to ef0f3af Compare March 18, 2026 06:24
@KethanaReddy7 KethanaReddy7 force-pushed the claude/issue-640-20260312-1031 branch from ef0f3af to 6918ceb Compare March 18, 2026 06:51
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.

1 participant