Open spiralman opened 3 days ago
Interesting. I could reproduce, but I really had to go crazy on the slider. I'll try to check what's going on. The issue is that I had to borrow a mouse to reproduce the issue and I don't have one for now :sweat_smile:
Thanks @Sharcoux. FWIW, I've found an easy way to reproduce it on a phone is, if the slider goes full-width on the device, you can use your two thumbs to tap back and forth between the left and right sides of the slider more rapidly than with a single finger (although, I can definitely get it to happen with just a single finger).
Did you try with the latest version? The snack uses an older version.
@Sharcoux We can reproduce the bug using 7.2.1, which is the current latest version.
Describe the bug If you rapidly tap/click on the slider to move the position, the slider will eventually get "stuck" at a fixed position. All calls to the
onSlidingStart
andonSlidingComplete
callbacks will receive the "stuck" value (which is whatever thevalue
prop is set to), but calls toonValueChange
will receive the actual value represented by the position the user tapped/clicked.This is easily reproduced with your demo app, without changes. We've also reproduced this in Android and iOS apps (not using Expo).
To Reproduce
onSlidingStart
andonSlidingComplete
callbacks get the "stuck" value (whatever thevalue
prop is set to), but theonValueChange
callback gets the correct value for wherever you click/drag.Expected behavior The thumb should not get "stuck", the callback to
onSlidingStart
andonSlidingComplete
should get a value representative of the position the user tapped/clicked/dragged the thumb, not whatever the currentvalue
prop is set to.Screenshots See this example console output, from after the bug has been triggered:
Please complete the following information:
Additional context Note: it appears to be possible to work around this issue by updating the parent component's
value
state in theonValueChange
callback, which causes the correctvalue
to be passed back down into the slider, thus resulting in theonSlidingStart/Complete
callbacks getting the updated value.