githuboftigran / rn-range-slider

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

Solve the Touchable in Model #145

Open Darkwaqar opened 1 year ago

Darkwaqar commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch rn-range-slider@2.2.2 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/rn-range-slider/index.tsx b/node_modules/rn-range-slider/index.tsx
index 37163ae..80b399a 100644
--- a/node_modules/rn-range-slider/index.tsx
+++ b/node_modules/rn-range-slider/index.tsx
@@ -1,11 +1,11 @@
 import React, {
+  ReactNode,
   memo,
-  useState,
-  useEffect,
   useCallback,
+  useEffect,
   useMemo,
   useRef,
-  ReactNode,
+  useState,
 } from 'react';
 import {
   Animated,
@@ -16,15 +16,15 @@ import {
   ViewProps,
 } from 'react-native';

-import styles from './styles';
+import { clamp, getValueForPosition, isLowCloser } from './helpers';
 import {
-  useThumbFollower,
-  useLowHigh,
-  useWidthLayout,
   useLabelContainerProps,
+  useLowHigh,
   useSelectedRail,
+  useThumbFollower,
+  useWidthLayout,
 } from './hooks';
-import {clamp, getValueForPosition, isLowCloser} from './helpers';
+import styles from './styles';

 const trueFunc = () => true;
 const falseFunc = () => false;
@@ -188,7 +188,7 @@ const Slider: React.FC<SliderProps> = ({
   const {panHandlers} = useMemo(
     () =>
       PanResponder.create({
-        onStartShouldSetPanResponderCapture: falseFunc,
+        onStartShouldSetPanResponderCapture: trueFunc,
         onMoveShouldSetPanResponderCapture: falseFunc,
         onPanResponderTerminationRequest: falseFunc,
         onPanResponderTerminate: trueFunc,

This issue body was partially generated by patch-package.

lamzaaa commented 4 months ago

Been struggle with this, thanks for your help. They should add option for this to work in modal