Skip to content

TT-7622 fix: focus wheel picker on click so keyboard arrows work - #535

Open
nabalone wants to merge 1 commit into
developfrom
TT-7622_wheel-picker-keyboard-arrows
Open

TT-7622 fix: focus wheel picker on click so keyboard arrows work#535
nabalone wants to merge 1 commit into
developfrom
TT-7622_wheel-picker-keyboard-arrows

Conversation

@nabalone

Copy link
Copy Markdown
Collaborator

Summary

Fixes TT-7622: in the Mark Verses → Edit Reference dialog, the Chapter/Verse/Suffix wheel pickers did not respond to the keyboard Up/Down arrow keys after being clicked.

Root cause

The wheel pickers use @ncdai/react-wheel-picker, which does have built-in Arrow-key handling on its internal [data-rwp] element — but that element only receives keyboard focus when tabbed to. On click, the library calls preventDefault() on mousedown (to drive its drag/scroll gesture), and preventDefault on mousedown also stops the browser from moving focus to the element. So after the user clicked a wheel (the exact repro steps), the wheel never had focus and its arrow-key handler never fired.

Fix

Focus the wheel's internal element ourselves in an onClick handler on the wheel column wrapper. Keyboard users who tab in already get focus for free, so this is a no-op for them; it only closes the click-then-arrow gap.

Test plan

  • Verified in the running dev app (real component + real library) via a standalone render harness:
    • Click a verse wheel → focus lands on the wheel; ArrowDown changes 78→79, ArrowUp changes 5→4; the change persists on Save.
    • Confirmed the bug reproduces with the fix removed (click leaves focus off the wheel; arrows do nothing).
  • npm run typecheck — clean
  • eslint on the changed file — clean
  • jest EditReferenceDropdown — 7/7 pass

🤖 Generated with Claude Code

The Edit Reference wheel pickers (@ncdai/react-wheel-picker) have built-in
Arrow-key handling on their internal element, but that element only received
focus when tabbed to. On click the library calls preventDefault() on mousedown
to drive its drag/scroll, which also stops the browser from focusing the wheel,
so after clicking a wheel the Up/Down arrow keys did nothing. Focus the wheel
ourselves on click to close that gap; tab users already get focus for free.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@nabalone
nabalone marked this pull request as ready for review August 26, 2026 00:39
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