You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 68b7c0c
Browse filesBrowse the repository at this point in the historyBrowse files
fix(DateInput, DateTimeInput): the sheet's calendar pages like UIDatePicker under a finger
Under a finger (a coarse pointer), on iPhone and Android alike, the sheets'
calendar is MonthPager, on #8146's usePager: a swipe moves at most one
month, chosen at the lift by UIKit's paging rule, and settles on its paging
curve; the title follows the drag and the settle, changing at half a month;
the arrows step on setContentOffset's 0.3 s sinusoid, a second tap going on
to the month after; inside the sheet, a drag steeper than 45 degrees moves
the sheet and one flatter than about 27 degrees pages the calendar; a
horizontal trackpad swipe pages one month per gesture. With a mouse the
calendar keeps today's native scroller, which now takes PageUp/PageDown and
follows design:reduced-motion for its arrows (at once with a mouse, an
opacity dip on a touch screen, through reducedMotionFade).
MonthPager is reached through the pickers' touch layer,
DateInput/datePickerTouch.ts.
[fix] Under a finger, the calendar in the DateInput and DateTimeInput bottom sheets now pages its months like the iOS date picker, on iPhone and Android alike:
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 and the settle that ends it. It changes when the next month is more than half in view, not at the lift.
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, one flatter than about 27° pages the calendar, and one in between moves neither, as on iOS.
11
+
- A horizontal trackpad swipe, or Shift with a mouse wheel, pages one month per gesture too.
12
+
13
+
With a mouse, the calendar keeps today's native scrolling. On every pointer, PageUp and PageDown now move the keyboard focus by a month, and with Shift by a year.
14
+
15
+
With Reduce Motion on (`design:reduced-motion`), the months no longer travel: under a finger the arrows' step and a swipe's settle cross-fade in 200 ms, and with a mouse the arrows change the month at once.
0 commit comments