Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Issue number: resolves #30449
What is the current behavior?
ion-picker-columncommits the centered option on a 250ms idle timer that only starts once the wheel stops moving. Flick a wheel and tap a Save button while it's still coasting, and the click handler reads the previous value. On anion-datetimewithpreferWheel, the wheel shows one date whilevaluestill reports another.What is the new behavior?
During a scroll the user started, the column watches for
pointerdownanywhere outside itself. On that press it halts the wheel on the option under the highlight and commits it synchronously, so an application's own click handler reads the value the user can see. A press on a sibling wheel in the same picker is exempt, so reaching for the next column leaves the first one coasting. The datetime wheel handlers now read the working and active parts at event time, because an outside press settles every coasting column in one synchronous dispatch and the previous render-time reads clobbered each other.Does this introduce a breaking change?
Other information
The community PR for this issue, #30674, was a great attempt, but it takes the reporter's other suggestion and adds public
ionScrollStartandionScrollEndevents toion-picker-columnandion-datetime. I didn't go that way for two reasons. It's permanent public API on two components plus the Angular and Vue proxies, carried by every consumer forever, to work around a bug. More importantly it doesn't fix the stale value: every app has to write the disable-Save logic itself, and itsionScrollEndis debounced 300ms after the wheel settles, so a tap during the flick still reads the old value at the moment the click handler runs. Committing onpointerdownfixes existing apps with no code change. The scroll events are a fair feature request on their own, just a separate one from this bug fix.Preview: