Repository navigation
Commit 1c1e238
committed
feat(Wheel): UIPickerView's wheel in the iOS idiom, on the gesture recognizer and compositor curves
The picker wheel is a native scroll-snap column. WebKit gives every
scroll-snapping scroller the fast deceleration rate (0.99/ms) while
UIPickerView decelerates at the normal rate (0.998) onto a row it picks from
its own projection, and a native scroll's momentum cannot be caught or held
to a curve. In the iOS idiom (WebKit on iOS or iPadOS under a finger) the
Wheel is now UIPickerView's, PickerWheel.tsx, on the gesture system and the
picker's values in the UIKit constants table:
- A PanGestureRecognizer drags the rows, on UIKit's rubber band past an end.
The lift plays UIKit's release plan (wheelPhysics.ts); a finger landing on
a moving wheel stops it where it is; a tap turns a row onto the band.
- Each motion plays through wheelMotion.ts: per-row Web Animations on the
compositor, each row turned onto the cylinder, with a selection tick per row
reached where the browser can vibrate.
- The tap spin's duration and curve and the bounce at an end are the theme's
motion roles (picker.tapSpin.durationMs, timing.curves.easeInOut,
scroll.bounce), resolved against the column as each motion starts.
- The value commits when the wheel comes to rest; keys and clicks commit at
once and turn the wheel.
- isLooping, resolveRest and a spinTo(index) handle for the date and time
wheels.
- WheelGroup: one band and one vanishing point across picker columns. A Wheel
on its own draws its own band.
- The column keeps the pointer of a finger that lands on it, as it keeps the
touch: a BottomSheet would otherwise arm its pull-down on the pointer and
follow the first 8 px of a downward drag.
The switch reads the sheet's touch modes through usePresentation
(architecture:public-component-api INV16): a wheel shows only on a sheet,
so a caller who pins the fine surface gets no sheet and no wheel.
Everywhere else (Android, a mouse) Wheel keeps today's scrolling column, now
named ScrollWheel and otherwise unchanged; there spinTo commits at once and
isLooping and resolveRest do nothing, and WheelGroup renders its children
alone. The shared types and nearestEnabledIndex move to wheelOptions.ts.1 parent d19effd commit 1c1e238
13 files changed
Lines changed: 2025 additions & 90 deletions
File tree
- .changeset
- .github/workflows
- packages/core/src/DateInput
- __tests__
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1623 | 1623 | | |
1624 | 1624 | | |
1625 | 1625 | | |
1626 | | - | |
| 1626 | + | |
| 1627 | + | |
1627 | 1628 | | |
1628 | 1629 | | |
1629 | 1630 | | |
| |||
1668 | 1669 | | |
1669 | 1670 | | |
1670 | 1671 | | |
1671 | | - | |
1672 | | - | |
1673 | | - | |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
1674 | 1676 | | |
1675 | 1677 | | |
1676 | 1678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| |||
2572 | 2573 | | |
2573 | 2574 | | |
2574 | 2575 | | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
2575 | 2608 | | |
2576 | 2609 | | |
2577 | 2610 | | |
| |||
0 commit comments