Unable to move the thumb position from outside the slider when having a custom thumbImage
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react-native, typescript
- Lĩnh vực
- mobile
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ Slider được kiểm soát với thumbImage tùy chỉnh và so sánh với hành vi thumb mặc định. Theo dõi cách các thay đổi giá trị từ bên ngoài được áp dụng khi thumbImage được thiết lập; hoàn thành có nghĩa là khi nhấn nút, thumb tùy chỉnh di chuyển đến vị trí 0 giống như khi không có hình ảnh tùy chỉnh.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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<number>(20)
return (
<>
<Button
title={'Change value'}
onPress={(): void => setValue(0)}
/>
<View style={tw`justify-center`}>
<Slider
minimumValue={0}
maximumValue={100}
step={5}
value={value}
onValueChange={handleChange}
minimumTrackTintColor="#62A6E433"
maximumTrackTintColor="#62A6E433"
thumbTintColor={'#62A6E4'}
/>
</>
)
However, if you add a custom thumbImage, when clicking the button, the thumb position does not go to position 0:
const [value, setValue] = useState<number>(20)
return (
<>
<Button
title={'Change value'}
onPress={(): void => setValue(0)}
/>
<View style={tw`justify-center`}>
<Slider
minimumValue={0}
maximumValue={100}
step={5}
value={value}
onValueChange={handleChange}
minimumTrackTintColor="#62A6E433"
maximumTrackTintColor="#62A6E433"
StepMarker={(): ReactElement => <View style={tw`h-5`}></View>}
thumbTintColor={'#62A6E4'}
thumbImage={require('@src/assets/images/SliderThumb.png') as ImageURISource}
/>
</>
)
- Ngôn ngữ chính
- TypeScript
- Star
- 1.4k
- Fork
- 295
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của callstack/react-native-slider
-
bug report
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
callstack/react-native-slider#769 ·
-
bug report platform: iOS
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
callstack/react-native-slider#782 · 6 bình luận ·
-
bug report
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
callstack/react-native-slider#780 · 1 bình luận ·
-
bug report
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
callstack/react-native-slider#767 ·
-
bug report platform: iOS
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
callstack/react-native-slider#758 · 4 bình luận ·
Tất cả issue của callstack/react-native-slider
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
receptron/mulmoterminal#2264 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
components-web-app/docs#96 ·
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
simonsobs/tileviewer#114 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100