Skip to content

fix(web): focus current time for picker arrow keys - #2769

Draft
tyler-dane wants to merge 1 commit into
mainfrom
cursor/fix-timepicker-arrow-focus-bae6
Draft

fix(web): focus current time for picker arrow keys#2769
tyler-dane wants to merge 1 commit into
mainfrom
cursor/fix-timepicker-arrow-focus-bae6

Conversation

@tyler-dane

Copy link
Copy Markdown
Contributor

Summary

Keyboard Up/Down on the event start/end time pickers jumped to early-morning times (e.g. 12:15 AM) instead of moving one 15-minute interval from the current value (e.g. 5:30 PM → 5:15 PM).

Cause: react-select focuses the selected option with reference equality (options.indexOf(value)). Compass passes a separately constructed { label, value } object, so focus fell back to the first option while visual scroll still showed the selected time.

Fix: Resolve the select value to the matching object from options before rendering. Custom (typed) times are inserted into the menu list in chronological order so they remain focusable too.

Test plan

  • bun run test:web -- packages/web/src/views/Forms/EventForm/DateControlsSection/DateTimeSection/TimePicker/
  • bun run lint (no new issues)
  • Manual: open event form, focus end time showing 5:30 PM, press ↑ → 5:15 PM focused; ↓ → 5:45 PM
Open in Web Open in Cursor 

react-select opens the menu with reference equality, so a separately
constructed value left keyboard focus on 12:00 AM. Resolve to the
matching option (or insert custom times) so Up/Down move one interval.

Co-authored-by: Tyler Dane <tyler-dane@users.noreply.github.com>
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.

2 participants