File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed
Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ function MyComponent() {
5858| ` color ` | ` string ` | ✓ | The color of the progress track and thumb |
5959| ` thumbShadowColor ` | ` string ` | | The shadow color of the thumb |
6060| ` gestureActiveRef ` | ` RefObject<boolean> ` | | A ` ref ` indicating whether the slider is being used |
61+ | ` hitSlop ` | ` object ` | | A [ ` hitSlop ` ] ( https://docs.swmansion.com/react-native-gesture-handler/docs/gestures/native-gesture/#hitslopsettings ) object |
6162
6263## Features
6364
Original file line number Diff line number Diff line change 11{
22 "name" : " @jellify-music/react-native-reanimated-slider" ,
3- "version" : " 0.2.1 " ,
3+ "version" : " 0.3.0 " ,
44 "description" : " A reusable slider component for React Native, powered by React Native Gesture Handler and Reanimated." ,
55 "main" : " ./lib/module/index.js" ,
66 "types" : " ./lib/typescript/src/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ interface SliderProps {
1919 backgroundColor : string ;
2020 color : string ;
2121 gestureActiveRef ?: React . RefObject < boolean > ;
22+ hitSlop ?: {
23+ top : number ;
24+ bottom : number ;
25+ left : number ;
26+ right : number ;
27+ } ;
2228}
2329
2430export default function Slider ( {
@@ -31,6 +37,7 @@ export default function Slider({
3137 thumbShadowColor,
3238 maxValue,
3339 gestureActiveRef,
40+ hitSlop,
3441} : SliderProps ) {
3542 const sliderWidth = useSharedValue ( 0 ) ;
3643
@@ -52,7 +59,7 @@ export default function Slider({
5259
5360 const panGesture = Gesture . Pan ( )
5461 . runOnJS ( true )
55- . hitSlop ( HIT_SLOP )
62+ . hitSlop ( hitSlop || HIT_SLOP )
5663 . onStart ( ( event ) => {
5764 if ( gestureActiveRef ) {
5865 gestureActiveRef . current = true ;
@@ -93,7 +100,7 @@ export default function Slider({
93100
94101 const tapGesture = Gesture . Tap ( )
95102 . runOnJS ( true )
96- . hitSlop ( HIT_SLOP )
103+ . hitSlop ( hitSlop || HIT_SLOP )
97104 . onBegin ( ( event ) => {
98105 if ( gestureActiveRef ) {
99106 gestureActiveRef . current = true ;
You can’t perform that action at this time.
0 commit comments