Closed SorooshDeveloper closed 1 month ago
A simple workaround is to manually add a margin
const SliderThumb = ({orderSide, progress}) => {
const {theme} = useTheme();
const backColor = orderSide === 'buy' ? theme.marketGreen : theme.marketRed;
const animatedStyle = useAnimatedStyle(() => {
return {
marginLeft: interpolate(progress.value, [0, 100], [0, 8]),
};
});
return (
<Animated.View
style={[
animatedStyle,
{
height: 10,
width: 10,
backgroundColor: theme.background,
borderWidth: 1,
borderColor: backColor,
transform: [{rotate: '45deg'}],
zIndex: 99999,
},
]}
/>
);
};
@SorooshDeveloper hey, what if you added the thumbWidth
prop to the Slider?
@alantoa i needed to set both mark width and thumbwidth to fix the issue!
@alantoa this is fixed i will close this issue, thanks for the help.
Hello when i use custom renderThumb, thumb will get an offset from the slider as the image below shows when progress is 100 thumb should be exactly on the last step but it has a margin!![Screenshot 2024-04-30 at 11 57 57 PM](https://github.com/alantoa/react-native-awesome-slider/assets/163350653/7aed2195-16c4-49fd-8135-e6fc12b9d433)
this my render thumb :