-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Slider stuck when value is set #2515
Comments
Currently i implemented a ghettofix by updating the value of the slider with an |
Same issue here. I used patch-package for a hotfix. Here's the patch:
diff --git a/node_modules/react-native-elements/src/slider/Slider.js b/node_modules/react-native-elements/src/slider/Slider.js
index 8deb5c2..fd95254 100644
--- a/node_modules/react-native-elements/src/slider/Slider.js
+++ b/node_modules/react-native-elements/src/slider/Slider.js
@@ -77,16 +77,18 @@ class Slider extends React.Component {
onPanResponderTerminate: this.handlePanResponderEnd.bind(this),
});
this.isVertical = props.orientation === 'vertical';
+
+ this.componentDidUpdate(props, true);
}
- componentDidUpdate(prevProps) {
+ componentDidUpdate(prevProps, force) {
const newValue = getBoundedValue(
this.props.value,
this.props.maximumValue,
this.props.minimumValue
);
- if (prevProps.value !== newValue) {
+ if (prevProps.value !== newValue || force) {
if (this.props.animateTransitions) {
this.setCurrentValueAnimated(newValue);
} else {
|
Any reason the patch was not included in the version |
Hi @ivansenic |
…k issue. Issues Fixed. - allowTouchTrack` Slider thump position is off when sliding react-native-elements#2509 - Slider stuck when value is set react-native-elements#2515
Update: The slider is not actually stuck but the button initially goes to the start, if you try to slide from where it should be, it does slide and stays to its proper position.
Explain what you did (Required)
useing the slider component with a value from state
Expected behavior (Required)
being able to slide
Describe the bug (Required)
slider is stuck at minimum position and wont respond to input
To Reproduce (Required)
Unable to reproduce on snack
but here it is how i have implemented it
https://snack.expo.io/PBHVS_RlT
Screenshots (Required)
Your Environment (Required):
The text was updated successfully, but these errors were encountered: