githuboftigran / rn-range-slider

A native slider with range
MIT License
234 stars 130 forks source link

Slider not working on Modal #134

Open sandeepsuthar opened 1 year ago

sandeepsuthar commented 1 year ago

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

mustafaAwwal commented 1 year ago

I am having the same problem in my implementation.

fahad86 commented 1 year ago

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

leonardorib commented 1 year ago

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.

Muthu011 commented 1 year ago

Is it fixed ? any workarounds available for this?

spirit1616 commented 1 year ago

With version 2.1.1 it works.

nanokoko89 commented 1 year ago

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(() => , []); const renderRail = useCallback(() => , []); const renderRailSelected = useCallback(() => , []); const renderLabel = useCallback((value) =>

return ( <> <View style={{ flexDirection: "row", justifyContent: "space-between", marginVertical: 10, }}

<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 commented 1 year ago

anyone fix this? Got same problem!

prakashkrsingh0 commented 1 year ago

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

fahad86 commented 1 year ago

I found that having the slider inside <Pressable> element makes it to not function.

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

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

cs-ashiqu commented 1 year ago

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

Caliman-Nicolae commented 1 year ago

Update package manually

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

It will work inside modal @cs-ashiqu

Zakyyy commented 1 year ago

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

Wictor-dev commented 1 year ago

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.

vrajmehta22 commented 7 months ago

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 :).

danielcollsol commented 5 days ago

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