Repository navigation
Commit 2d5b2a0
committed
fix(Wheel): the touch wheel draws only the rows around its band
Under a finger, opening a DateInput or DateTimeInput bottom sheet, and its
month and year wheels, held the main thread longer for each year in the
range: every wheel drew every row twice (on the cylinder, each its own 3D
layer, and on the band's copy). In Mobile Safari (iOS 26.2 simulator),
opening the year wheel of a 200-year range held the page for 278-754 ms; it
now takes 54-65 ms.
UIPickerView lays out only the cells it shows. PickerWheel now draws a
window of rows: on the cylinder its front half (rows within 90 degrees of
the band), and on the band's copy the row under the band and one each side,
each with a buffer of 2: 15 and 7 rows at most at rest, for any list.
Every motion mounts the rows it will show before it plays (flushSync), so
its cost follows the distance it travels; a reduced-motion cross-fade
mounts its target's rows at the fade's midpoint; a drag moves the window
when the finger nears its edge; the window settles back around the rest.
The band copy's rows sit at their positions along the wheel, so a looping
wheel needs no copies of its strip. WheelMotion attaches rows by index and
carries a running motion through a re-attach: rows that mount join it in
step, rows that unmount leave it, and rows that mount during a cross-fade
show where it is.
The listbox's options are separate, plain and complete, stacked
transparent over the band: assistive technology meets every option, and
both drawings carry their text as generated content.
Also: WheelGroup flags when its element is attached (the element stays in
a ref), so a Wheel places its vanishing point at the group's centre once
the group mounts; and a test holds the gesture host's selection lock on
the column under a held finger.
Stories BottomSheetWideRange (200 years) and BottomSheetNarrowRange
(2 years) back the browser proof. Under a mouse, its year wheel stays
today's column with every year listed.
Wheel.interaction.browser.spec.ts marks the row drawn on the cylinder for
its busy-main-thread proof (the option it marked is transparent now).1 parent 1cfe5aa commit 2d5b2a0
11 files changed
Lines changed: 1021 additions & 222 deletions
File tree
- .changeset
- apps/storybook/stories
- 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 | |
|---|---|---|---|
| |||
832 | 832 | | |
833 | 833 | | |
834 | 834 | | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
0 commit comments