Repository navigation
Thumb flickers and jumps when slider value is set programmatically #716
Copy link
Copy link
Open
Labels
bug reportSomething isn't workingSomething isn't workingv6Issues that are either resolved by, or checked against the v6 releaseIssues that are either resolved by, or checked against the v6 release
Description
Environment
info Fetching system and libraries information...
System:
OS: Windows 11 10.0.22631
CPU: "(12) x64 AMD Ryzen 5 7530U with Radeon Graphics "
Memory: 14.63 GB / 31.35 GB
Binaries:
Node:
version: 22.16.0
path: ~\AppData\Local\fnm_multishells\16944_1750346856565\node.EXE
Yarn:
version: 1.22.22
path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
npm:
version: 10.9.2
path: ~\AppData\Local\fnm_multishells\16944_1750346856565\npm.CMD
Watchman: Not Found
SDKs:
Android SDK:
API Levels:
- "34"
- "35"
Build Tools:
- 30.0.3
- 34.0.0
- 35.0.0
System Images:
- android-34 | Google Play Intel x86_64 Atom
- android-35 | Google Play Intel x86_64 Atom
Android NDK: Not Found
Windows SDK:
AllowDevelopmentWithoutDevLicense: Enabled
AllowAllTrustedApps: Enabled
Versions:
- 10.0.26100.0
IDEs:
Android Studio: AI-243.24978.46.2431.13208083
Visual Studio: Not Found
Languages:
Java: 17.0.12
Ruby: Not Found
npmPackages:
"@react-native-community/cli":
installed: 18.0.0
wanted: ^18.0.0
react:
installed: 18.3.1
wanted: 18.3.1
react-native:
installed: 0.76.9
wanted: ^0.76.9
react-native-windows: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: Not found
newArchEnabled: Not found
iOS:
hermesEnabled: Not found
newArchEnabled: Not found
info React Native v0.80.0 is now available (your project is running on v0.76.9).
info Changelog: https://github.com/facebook/react-native/releases/tag/v0.80.0
info Diff: https://react-native-community.github.io/upgrade-helper/?from=0.76.9&to=0.80.0
info For more info, check out "https://reactnative.dev/docs/upgrading?os=windows".
-
are you using the new architecture? Yes
-
which version of react & react-native are you using? 18.3.1
Description
I'm using Expo 52 and using a simple Slider that follows the official documentation, and the slider thumb just jumps and causes weird UI behavior. I'm using an Expo Development Build and testing it on an Android device. Here's the simple example:
Reproducible Demo
export const LightLevel = () => {
const [value, setValue] = useState(10)
return (
<>
<Text>Light: {value && +value.toFixed(3)}%</Text>
<Slider
style={{ width: 200 }}
step={1}
minimumValue={0}
maximumValue={100}
value={value}
onValueChange={setValue}
minimumTrackTintColor={'#00629A'}
maximumTrackTintColor={'#979EA4'}
/>
</>
)
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bug reportSomething isn't workingSomething isn't workingv6Issues that are either resolved by, or checked against the v6 releaseIssues that are either resolved by, or checked against the v6 release
Activity
panna-oo commentedon Jun 20, 2025
@abrahamgalue
debounce((val) => {
setValue(val);
}, 50);
abrahamgalue commentedon Jun 27, 2025
This only delays the bug, but does not solve the problem.
IlyaPasternakAmitech commentedon Jul 8, 2025
I'm facing the same issue with the thumb flickering and jumping when setting the value programmatically.
As a temporary workaround, I’ve implemented a check using isSliderTouched to ensure that setValue is only triggered during user interaction (onTouchStart / onTouchEnd). This seems to prevent the flickering/jumping behavior for now:
While this doesn't fix the root cause, it at least stops the slider from jumping when the value is updated externally.
abrahamgalue commentedon Jul 8, 2025
For now, in my app, I'm using a similar approach. For my status, I use Zustand since there are several parameters that are going to be changed, but here's an example.
The only issues I've encountered are that the brightness value doesn't update in real time, and in the React inspector with the React Developer Tools, the slider seems to re-render many times when you move it to change its value. This is unlike when using a similar approach to the one in the documentation, which seems more optimized, but causes these flickering and jumps.
For now, I'll leave it with this approach until I get more information or an official solution.
draggie commentedon Jul 17, 2025
Hi, thanks for reporting.
I have tried reproducing that on both provided setup and our example which runs on React 19.0 and React Native 79 but without much success.
Could you maybe record video or give some more context ?
For me setting value programatically works fine, I do not see any flickering, at least not on the emulator.
abrahamgalue commentedon Jul 20, 2025
@draggie Of course, as I said before I am using an Expo build for development and I run the project with the
bunx expo startcommand on a physical device with Android 15, using React 18.3.1 and react-native 0.76.9, with Expo 52, because in Expo 53 there is a problem with the Supabase library that I use for authentication so I hope they fix it to update.Here you have a little video to see the behavior I am getting:
Screenrecorder-2025-07-20-13-44-20-924.mp4
dayanch-n commentedon Aug 5, 2025
Facing same issue on Android emulator, react-native v0.77.2. As a workaround for now using onSlidingComplete instead of onValueChange
petitTrung commentedon Aug 6, 2025
+1 We are currently facing the same issue on a real Android (OnePlus 6T Android 11)
petitTrung commentedon Aug 7, 2025
I think I figured out, lets take a look at the documentation
So I guess in your case @abrahamgalue , the
valueattribute should theinitial valuethat should be passed to the component.We do not need to reset every time the
valueattribute when user drags the Slider, i.e when theonValueChangefunction gets calledabrahamgalue commentedon Sep 19, 2025
Yes, I read that part of the documentation. My goal with the Slider is to change the brightness intensity in my application (of anything, for example), and I want the 'Brightness: 62%' value to update accordingly as the user slides the slider.
That's my goal, and when the user stops interacting (lifts their finger from the slider), that value is saved in a database, for example.
I was trying to look for examples, but I couldn't find many in the documentation beyond this temporary solution I implemented, which doesn't reflect the slider value in real time, only when the user stops interacting.