callstack / callstack/react-native-slider
Unable to move the thumb position from outside the slider when having a custom thumbImage
- Dominant language
- TypeScript
- Stars
- 1.4k
- Forks
- 295
- Avg merge
- 5m
- Merged PRs (30d)
- 1
Description
## Environment
* react-native info output:
```
// react-native info
Expo v53
```
* are you using the new architecture?
yes
* which version of react & react-native are you using?
React 19 and React Native v0.79.2
## Description
When having a custom thumbImage, the position of the thumb is not able to be updated from outside the Slider. For example, if you have a useEffect that change the value of the slider, the thumb position is being moved when thumbImage is by default. However, with a custom thumbImage, it's not the case.
## Reproducible Demo
If you have something like this, clicking the button should move well the thumb position to position 0:
```
const [value, setValue] = useState(20)
return (
<>
setValue(0)}
/>
)
```
However, if you add a custom thumbImage, when clicking the button, the thumb position does not go to position 0:
```
const [value, setValue] = useState(20)
return (
<>
setValue(0)}
/>
}
thumbTintColor={'#62A6E4'}
thumbImage={require('@src/assets/images/SliderThumb.png') as ImageURISource}
/>
)
```
Contributor guide
Research direction
Start by reproducing the controlled Slider example with a custom thumbImage and compare it with the default thumb behavior. Trace how external value changes are applied when thumbImage is set; done means pressing the button moves the custom thumb to position 0 as it does without a custom image.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react-native, typescript
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100