-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
API request: add OnChangeEnded API to the Slider widget #3652
Comments
Actually maybe adding an The use case for this one is a little less widespread though, I'd imagine |
I have actually thought about if we instead should try to change the behavior to trigger the |
In some cases it's useful to respond to valueChanged during the drag. e.g. a color slider, or in my app's case, a volume slider that can update the volume during a drag. (my seek slider only invokes the action on drag end though). Andy and I discussed this a bit in Discord |
Hmm. Interesting. I have never personally found any use for having it update continuously but your usage seems very sensible. Having a |
I'm also adding the |
Landed on |
Checklist
Is your feature request related to a problem?
In some apps it is necessary to differentiate ValueChanged events to a slider that are occurring during a drag action, vs a ValueChanged that occurs at the end of a user interaction, in order to trigger backend logic only in the 2nd case.
Is it possible to construct a solution with the existing API?
Yes, by extending Slider, overriding
DragEnd
(and later overridingTapped
as well once tap-to-set support lands in the slider widget), to keep track of when the user interaction ends yourselfDescribe the solution you'd like to see.
A new callback API to the slider widget
OnChangeEnded func()
which allows application code to be notified when a user interaction that is changing the slider value has completed. Maybe the signature should beOnChangeEnded func(float)
where the last set value is passed as wellThe text was updated successfully, but these errors were encountered: