Commit 52aa59a
fix(Calendar): focus first day when no selected or today cell on initial focus (#2676)
The third fallback branch of handleCalendarInitialFocus queried for
`[data-reka-calendar-day]`, an attribute that no component renders (day cells
expose `data-reka-calendar-cell-trigger` and friends instead). As a result,
when neither a selected day nor today is present in the visible view (e.g. an
unselected calendar whose displayed month does not contain today), initial
focus landed nowhere.
Switch the fallback to `[data-value]:not([data-outside-view]):not([data-disabled])`.
`data-value` is shared by every calendar/picker cell trigger, so the fix covers
Calendar, RangeCalendar, DatePicker, DateRangePicker and the Month/Year (Range)
pickers alike, and it matches the selector reka-ui already uses internally for
cell navigation.
Co-authored-by: nakagam3 <botch.10npo@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 40232d3 commit 52aa59a
2 files changed
Lines changed: 15 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
899 | 900 | | |
900 | 901 | | |
901 | 902 | | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
902 | 916 | | |
903 | 917 | | |
904 | 918 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
0 commit comments