react-native-slider icon indicating copy to clipboard operation
react-native-slider copied to clipboard

Property disbaled dont work

Open pdaus1405 opened this issue 3 years ago • 5 comments

Environment

System: OS: macOS 12.0.1 CPU: (4) x64 Intel(R) Core(TM) i5-7267U CPU @ 3.10GHz Memory: 1.02 GB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 17.0.1 - /usr/local/bin/node Yarn: 1.22.17 - /usr/local/bin/yarn npm: 8.1.0 - /usr/local/bin/npm Watchman: 2021.11.15.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.2 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.0.1, iOS 15.0, macOS 12.0, tvOS 15.0, watchOS 8.0 Android SDK: Not Found IDEs: Android Studio: Not Found Xcode: 13.1/13A1030d - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.66.0 => 0.66.0 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

Description

If the value for disabled is set to true, it has no effect. The slider can still be moved. Will try on the web.

Reproducible Demo

<ReactSlider
        style={[styles.slider]}
        value={value}
        disabled={true}
        minimumValue={minimumValue}
        maximumValue={maximumValue}
        step={step}
        thumbTintColor={thumbTintColor}
        minimumTrackTintColor={minimumTrackTintColor}
        maximumTrackTintColor={maximumTrackTintColor}
        onValueChange={newValue => onValueChange(newValue)}
      />

pdaus1405 avatar Dec 07 '21 11:12 pdaus1405

Hello @pdaus1405! Can you tell me on which platform do you see this issue? I assume you're using the latest version of the library (v4.1.12), right?

BartoszKlonowski avatar Dec 07 '21 11:12 BartoszKlonowski

hey @BartoszKlonowski

"@react-native-community/slider": "^4.1.12",

"react-native": "0.66.0",

"react-native-web": "^0.17.5"

i hope this information can help you :)

pdaus1405 avatar Dec 07 '21 11:12 pdaus1405

Same issue here. The disabled property works correctly on iOS devices, but in the browser (Chrome 97) the slider is not disabled.

<Slider maximumValue={6} minimumValue={0} step={1} value={value} disabled onSlidingComplete={onChange} />

"@react-native-community/slider": "4.1.12" "expo": "^43.0.0" "react-native": "0.64.3" "react": "17.0.1"

seidbar avatar Jan 10 '22 09:01 seidbar

I have the same issue. Additionally, it does not matter how onValueChange is set. Even if it does not update the value, the user can still move the slider around.

albert-schilling avatar Feb 23 '22 22:02 albert-schilling

A quick workaround for me was to just wrap the slider in a View and disable pointerEvents on it as a surrogate to disabled

seidbar avatar Feb 24 '22 07:02 seidbar

Fixed in https://github.com/callstack/react-native-slider/pull/462

jspizziri avatar Dec 16 '22 11:12 jspizziri