callstack / react-native-slider

React Native component exposing Slider from iOS and SeekBar from Android
MIT License
1.19k stars 267 forks source link

Upper/lower limits not working #469

Closed mamonovv closed 1 year ago

mamonovv commented 1 year ago

Environment

System: OS: Linux 5.15 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish) CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz Memory: 10.77 GB / 31.21 GB Shell: 5.1.16 - /bin/bash Binaries: Node: 14.21.1 - /usr/bin/node Yarn: Not Found npm: 6.14.17 - /usr/bin/npm Watchman: Not Found SDKs: Android SDK: Not Found IDEs: Android Studio: Not Found Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: 18.1.0 => 18.1.0 react-native: 0.70.5 => 0.70.5 npmGlobalPackages: react-native: Not Found

Description

The new upper/lower limits feature doesn't work, the slider goes over those limits easily.

Reproducible Demo

interface ICustomSlider { value: number maxPercentage: number onValueChange: (value: number) => void containerStyles: object }

const CustomSlider: FCC = ({containerStyles, maxPercentage, value, onValueChange}) => {

return (
    <View style={[shadows.basic, containerStyles]}>
        <LinearGradient
            start={{x: 0, y: 0}}
            end={{x: 1, y: 0}}
            colors={gradients.cold}
            style={CustomSliderStyles.linearGradient}
        >
            <Slider
                onValueChange={(v: any) => onValueChange(v)}
                value={value}
                step={0.1}
                upperLimit={20}
                maximumValue={100}
                minimumTrackTintColor={'transparent'}
                maximumTrackTintColor={'transparent'}
                // thumbStyle={{...CustomSliderStyles.brightThumb, ...shadows.basic}}
            />
        </LinearGradient>
    </View>
)

};

export default CustomSlider;

mamonovv commented 1 year ago

I am using webstorm for development and android studio to run the emulator. When I run it with the --tunnel flag on the phone, it doesn't work either.

k0va1 commented 1 year ago

+1, had the same issue on ios

briandu commented 1 year ago

same on iOS

manufdz19 commented 1 year ago

+1

Szafa99 commented 1 year ago

+1 Android and IOS

mzdon commented 1 year ago

I see the lowerLimit preventing sliding past the lower limit, but it doesn't prevent me from tapping below the lower limit. The slider will move past the lower limit if tapped.

chaitu3399 commented 3 months ago

Yes same problem here. Is there any solution to solve that issue