rn-range-slider icon indicating copy to clipboard operation
rn-range-slider copied to clipboard

Slider not working on Modal

Open sandeepsuthar opened this issue 2 years ago • 16 comments

When we added slide on Modal presentation popup, slide not working(touch not working ).

sandeepsuthar avatar Sep 21 '22 11:09 sandeepsuthar

I am having the same problem in my implementation.

mustafaAwwal avatar Sep 22 '22 06:09 mustafaAwwal

I'm seeing this too.. Any workarounds available for this?

fahad86 avatar Sep 30 '22 03:09 fahad86

Seeing this too.

I couldn't find the cause and was needing this as fast as possible for a project. If you are in the same situation you can use this package here: @miblanchard/react-native-slider. Definetly not perfect but solves this particular issue and works well enough in both platforms.

leonardorib avatar Oct 04 '22 19:10 leonardorib

Is it fixed ? any workarounds available for this?

Muthu011 avatar Oct 31 '22 04:10 Muthu011

With version 2.1.1 it works.

spirit1616 avatar Nov 12 '22 19:11 spirit1616

With version 2.1.1 it works.

This version i occur this error:

iOS Bundling complete 3183ms ERROR Invariant Violation: ViewPropTypes has been removed from React Native. Migrate to ViewPropTypes exported from 'deprecated-react-native-prop-types'. ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native. ERROR Invariant Violation: Failed to call into JavaScript module method AppRegistry.runApplication(). Module has not been registered as callable. Registered callable JavaScript modules (n = 11): Systrace, JSTimers, HeapCapture, SamplingProfiler, RCTLog, RCTDeviceEventEmitter, RCTNativeAppEventEmitter, GlobalPerformanceLogger, JSDevSupportModule, HMRClient, RCTEventEmitter. A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.

I tried to AppRegistry it:

import React, { useCallback, useState } from "react"; import RangeSliderRN from "rn-range-slider"; import { AppRegistry, View, Text } from "react-native";

import Label from "./Label"; import Notch from "./Notch"; import Rail from "./Rail"; import RailSelected from "./RailSelected"; import Thumb from "./Thumb";

const RangeSlider = ({ from, to }) => { const [low, setLow] = useState(from); const [high, setHigh] = useState(to);

const renderThumb = useCallback(() => <Thumb />, []); const renderRail = useCallback(() => <Rail />, []); const renderRailSelected = useCallback(() => <RailSelected />, []); const renderLabel = useCallback((value) => <Label text={value} />, []); const renderNotch = useCallback(() => <Notch />, []); console.log(123); const handleValueChange = useCallback( (newLow, newHigh) => { setLow(newLow); setHigh(newHigh); }, [setLow, setHigh] );

return ( <> <View style={{ flexDirection: "row", justifyContent: "space-between", marginVertical: 10, }} > <View> <Text style={[ { fontStyle: "italic" }, { textAlign: "left", fontSize: 14, color: "#D2D2D2" }, ]} > Min </Text> <Text style={[{ fontWeight: "bold" }, { fontSize: 18, color: "#000000" }]} > {low}€ </Text> </View> <View> <Text style={[ { fontStyle: "italic" }, { textAlign: "right", fontSize: 14, color: "#D2D2D2" }, ]} > Max </Text> <Text style={[{ fontWeight: "bold" }, { fontSize: 18, color: "#000000" }]} > {high}€ </Text> </View> </View> <RangeSliderRN // style={styles.slider} style={{ width: "100%" }} min={from} max={to} step={1} floatingLabel renderThumb={renderThumb} renderRail={renderRail} renderRailSelected={renderRailSelected} // renderLabel={renderLabel} // renderNotch={renderNotch} onValueChanged={handleValueChange} /> </> ); };

export default RangeSlider; AppRegistry.registerComponent("RangeSlider", () => RangeSlider);

But it now work. Anyone know how to fix this?

nanokoko89 avatar Nov 19 '22 08:11 nanokoko89

anyone fix this? Got same problem!

nanokoko89 avatar Nov 19 '22 08:11 nanokoko89

I have also the same issue. please inform me if somebody finds any solution.

prakashkrsingh0 avatar Dec 08 '22 13:12 prakashkrsingh0

I found that having the slider inside <Pressable> element makes it stop functioning.

After replacing all <Pressable> (or any views types which handle touch) with plain views it started working.

Now need to figure out how to handle existing behaviour without the parent <Pressable> view of the RangeSlider

fahad86 avatar Dec 14 '22 05:12 fahad86

Any updates here? I'm also facing the same issue? Is there any fix? @githuboftigran

cs-ashiqu avatar Jan 24 '23 15:01 cs-ashiqu

Update package manually

PanResponder.create({
   onStartShouldSetPanResponderCapture: trueFunc, // update this to trueFunc
})

It will work inside modal @cs-ashiqu

Caliman-Nicolae avatar Feb 10 '23 10:02 Caliman-Nicolae

@Caliman-Nicolae I am using it inside bottom sheet and still not working after updating PanResponder.create({ onStartShouldSetPanResponderCapture: trueFunc, // update this to trueFunc })

Zakyyy avatar Mar 07 '23 13:03 Zakyyy

Update package manually

PanResponder.create({
   onStartShouldSetPanResponderCapture: trueFunc, // update this to trueFunc
})

It will work inside modal @cs-ashiqu

That work for me as well, thanks.

Wictor-dev avatar Mar 28 '23 01:03 Wictor-dev

Hello Everyone same as you all i was facing the same problem for rn-slider just to fix this replace the following code in the index.tsx file of the rn-slider.. plugin in the node-modules

PanResponder.create({ onStartShouldSetPanResponderCapture: trueFunc, // this is the main thing to get replaced for fixture onMoveShouldSetPanResponderCapture: falseFunc, onPanResponderTerminationRequest: falseFunc, onPanResponderTerminate: trueFunc, onShouldBlockNativeResponder: trueFunc,

image_2023_12_09T06_09_43_890Z

I hope this will help :).

vrajmehta22 avatar Dec 09 '23 06:12 vrajmehta22

Any chance of updating the package with this fix? That would be greatly appreciated

danielcollsol avatar Jul 04 '24 09:07 danielcollsol

is this issue fixed? we are still facing it

hfarhanahmed avatar Jul 11 '24 10:07 hfarhanahmed