DateTimePicker: Infinite scroll for faster date/time selection#1280
Merged
mstijak merged 4 commits intoMay 19, 2026
Merged
Conversation
ognjenst
requested changes
Feb 2, 2026
Addresses review feedback on the infinite-scroll wheels: - Replace the XOR wrap-detection (only valid for single-step scrolls, misfires on multi-step touch jumps) with a direct check: recentre the wheel when a scroll lands outside the centre range of the 3x buffer. - buildNumberWheel() builds uniform, symmetric 3x buffers for the day, hour and minute wheels (previously 41/52/130 with thin trailing room). - year/month onChange now read the setState updater's `state` argument instead of `this.state`, consistent with the other wheels. - Track the first year in a `firstYear` field instead of reading it back from a rendered span's React key. - Pad option labels with String.padStart; remove the dead `??=` on numberOfDaysInMonth.
Replaces the per-wrap remount, which interrupted the scroll at every boundary, with seamless wrapping. WheelComponent gains a `cycle` flag: when set it renders the option list WHEEL_BUFFER_COPIES (3) times and, on prop updates, snaps to whichever copy of the value is nearest its current position. A wrap then scrolls one item into the adjacent identical copy — no remount and no scrollTop adjustment, so the motion is never interrupted. DateTimePicker passes the natural single option list plus the `cycle` flag, and drops the resetKey state entirely.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces infinite scrolling to the DateTimePicker component for both date and time columns.
The goal is to significantly improve the user experience when selecting values across large ranges (months, days, hours, minutes) by removing hard list boundaries and minimizing repetitive scrolling.