Prevent code from stomping on user slider dragging #1647
myieye
started this conversation in
Feature Requests / Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Currently if the user starts dragging the slider component, code can interrupt them, which is bad UX.
I think that by default or at least optionally, code should be blocked from doing so.
I ran into this problem while binding the slider to audio playback. There's no clean way to pause the audio fast enough when the user starts dragging, in order to preserve the user's selected position when they e.g. just click somewhere on the slider
To make it work, I very messily exposed drag start and stop events and had to make sure I wrote to the slider value in an $effect (rather than passing in the actual audio time $state), so that I could avoid touching the value when the user started sliding.
Beta Was this translation helpful? Give feedback.
All reactions