Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slider not working on Modal #134

Open
sandeepsuthar opened this issue Sep 21, 2022 · 16 comments
Open

Slider not working on Modal #134

sandeepsuthar opened this issue Sep 21, 2022 · 16 comments

Comments

@sandeepsuthar
Copy link

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

@mustafaAwwal
Copy link

I am having the same problem in my implementation.

@fahad86
Copy link

fahad86 commented Sep 30, 2022

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

@leonardorib
Copy link

leonardorib commented Oct 4, 2022

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
Copy link

Is it fixed ? any workarounds available for this?

@spirit1616
Copy link

With version 2.1.1 it works.

@nanokoko89
Copy link

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) => , []);
const renderNotch = useCallback(() => , []);
console.log(123);
const handleValueChange = useCallback(
(newLow, newHigh) => {
setLow(newLow);
setHigh(newHigh);
},
[setLow, setHigh]
);

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

<Text
style={[
{ fontStyle: "italic" },
{ textAlign: "left", fontSize: 14, color: "#D2D2D2" },
]}
>
Min

<Text
style={[{ fontWeight: "bold" }, { fontSize: 18, color: "#000000" }]}
>
{low}€



<Text
style={[
{ fontStyle: "italic" },
{ textAlign: "right", fontSize: 14, color: "#D2D2D2" },
]}
>
Max

<Text
style={[{ fontWeight: "bold" }, { fontSize: 18, color: "#000000" }]}
>
{high}€



<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
Copy link

anyone fix this? Got same problem!

@prakashkrsingh0
Copy link

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

@fahad86
Copy link

fahad86 commented Dec 14, 2022

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

@cs-ashiqu
Copy link

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

@Caliman-Nicolae
Copy link

Update package manually

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

It will work inside modal
@cs-ashiqu

@Zakyyy
Copy link

Zakyyy commented Mar 7, 2023

@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
Copy link

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
Copy link

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
Copy link

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

@hfarhanahmed
Copy link

is this issue fixed? we are still facing it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests