Skip to content

Commit 2631091

Browse files
committed
fix(DateInput, DateTimeInput): the sheet's calendar pages like UIDatePicker
MonthScroller pages on the shared pager (usePager) instead of native scroll snapping: one month per release by UIKit's paging rule, settling on UIKit's paging integrator; the title follows the drag at half a page; the arrows run setContentOffset's 0.3 s curve and retarget from where the grid is; inside a sheet, drags steeper than 45 degrees go to the sheet. Each pane gets its own layer. PageUp/PageDown (Shift: a year) move the keyboard focus. The scroll-settle correction and the native-swipe fallback are removed.
1 parent c735abc commit 2631091

10 files changed

Lines changed: 767 additions & 1121 deletions

File tree

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@astryxdesign/core': patch
3+
---
4+
5+
[fix] The calendar in the DateInput and DateTimeInput bottom sheets now pages its months like the iOS date picker:
6+
7+
- A swipe moves at most one month, chosen at the lift by iOS's paging rule (a quick flick, or past half a month). It settles on iOS's paging curve instead of letting a fling run across several months.
8+
- The month title follows the drag. It changes when the next month is more than half in view.
9+
- The arrows scroll the month in 0.3 s; a second tap mid-scroll goes on to the month after.
10+
- Inside the sheet, a drag steeper than 45° moves the sheet, and a flatter one stays with the calendar.
11+
- PageUp and PageDown move the keyboard focus by a month, and with Shift by a year.
12+
13+
@vjeux

‎apps/storybook/stories/DateInput.stories.tsx‎

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,26 @@ export const WithMinMax: Story = {
361361
},
362362
};
363363

364+
/**
365+
* The bottom-sheet calendar pages its months like the iOS date picker: one
366+
* month per swipe, the title following the drag, the arrows on a 0.3 s
367+
* curve.
368+
*/
369+
export const BottomSheetCalendar: Story = {
370+
render: args => {
371+
const [value, setValue] = useState<ISODateString | undefined>(
372+
'2026-10-15' as ISODateString,
373+
);
374+
return <DateInput {...args} value={value} onChange={setValue} />;
375+
},
376+
args: {
377+
label: 'Date',
378+
presentation: 'bottom-sheet',
379+
min: '2026-01-01' as ISODateString,
380+
max: '2026-12-31' as ISODateString,
381+
},
382+
};
383+
364384
export const WithMaxDateInLayout: Story = {
365385
render: args => {
366386
const [value, setValue] = useState<ISODateString | undefined>(undefined);

‎packages/core/src/DateInput/DateInput.spec.md‎

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,9 @@ approved policy.
186186

187187
- **PR1 — Bounded calendar window.** The bottom-sheet calendar mounts a bounded window
188188
of month panes around the visible month rather than the complete reachable century.
189-
- **PR2 — Scroll work.** Scroll-driven measurement and selection updates remain
190-
animation-frame throttled or settle-driven; listeners, frames, timers, and observers
191-
are cleaned up on deactivation or unmount.
189+
- **PR2 — Gesture work.** A drag moves the month grid without a render; the visible
190+
month is reported once per half-month crossed and once at the release; listeners,
191+
frames, timers, and observers are cleaned up on deactivation or unmount.
192192

193193
## Accessibility contract
194194

@@ -221,8 +221,7 @@ approved policy.
221221
`aria-selected` on the chosen day; ArrowLeft and ArrowRight move by a day
222222
following the reading direction, ArrowUp and ArrowDown by a week, Home and End
223223
to the ends of the week, PageUp and PageDown by a month, and Enter or Space
224-
picks the focused day. Implementation gap: PageUp/PageDown do not page by a
225-
month.
224+
picks the focused day.
226225

227226
## Design relationships
228227

0 commit comments

Comments
 (0)