callstack / callstack/react-native-slider

Unable to move the thumb position from outside the slider when having a custom thumbImage

未关闭
#712 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
bug report
主要语言
TypeScript
星标
1.4k
派生
295
平均合并
5 分钟
30 天内合并 PR
1

描述

## 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}
/>

)
```

贡献指南

打开贡献指南

调研方向

首先复现使用自定义 thumbImage 的受控 Slider 示例,并将其与默认 thumb 行为进行比较。跟踪设置 thumbImage 时外部值更改的应用方式;完成标准是按下按钮后,自定义 thumb 移动到位置 0,就像未使用自定义图像时一样。

由索引模型根据 Issue 内容生成。

评估

技术栈
react-native, typescript
领域
mobile
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。