Open jparksecurity opened 3 years ago
@jparksecurity @Donhv
I think it is a good idea to manage easily a disabled state.
But it can actually works by a different way waiting this feature request. With enabledOne and enabledTwo props. If you set theses props values to false it will disable the trigger on left and right markers.
In my case I created a useState and a useEffect that will set the disabled state value based on the toggle value.
Exemple:
<MultiSlider
values={values}
min={minValue}
max={maxValue}
containerStyle={styles.sliderContainer}
trackStyle={styles.sliderTrack}
selectedStyle={
!disabled
? styles.sliderSelected
: styles.sliderSelectedDisabled
}
sliderLength={WINDOW_WIDTH - 50}
onValuesChange={_handleValuesChange}
enabledOne={!disabled}
enabledTwo={!disabled}
/>
@anthlasserre
Sorry, I wasn't clear about what I wanted.
I don't want to move the slider by touching the slider, but I still want to be able to move a marker in order to change the value.
If I set enabledOne
and enabledTwo
to false, I can't change any value at all.
I want to disable the tapping and moving the slider, but I don't think there is any prop to do so.
I think this issue would be the opposite of https://github.com/ptomasroos/react-native-multi-slider/issues/57
Steps to Reproduce
Touch slider to move markers.
Expected Behavior
I don't move markers by touching the slider.
Added on Dec. 21 2020------------
I don't want to move markers by touching a slider, but I still want to be able to move a marker in order to change the value.
Actual Behavior
There is no prop to disable this behavior.