From fa62b9d10cfa5fcbe6339ae51ffc9e328f1d0ba5 Mon Sep 17 00:00:00 2001 From: Eden Memshulam Date: Sun, 29 Dec 2024 15:22:59 +0200 Subject: [PATCH] fix scroll bug --- src/index.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/index.tsx b/src/index.tsx index 5a6b3ca..26f3c37 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -268,7 +268,7 @@ export default forwardRef( ...config, velocity: typeof velocity !== 'number' ? undefined : velocity, }).start(); - }else { + } else { Animated.spring(animations.translateY, { toValue: initialValue.current, useNativeDriver: true, @@ -276,7 +276,7 @@ export default forwardRef( velocity: typeof velocity !== 'number' ? undefined : velocity, }).start(); } - + notifySnapIndexChanged(); }, // eslint-disable-next-line react-hooks/exhaustive-deps @@ -349,7 +349,9 @@ export default forwardRef( if (drawUnderStatusBar || props.onChange) { animationListener = animations.translateY.addListener(value => { const correctedValue = - value.value > minTranslateValue.current ? value.value - minTranslateValue.current : 0; + value.value > minTranslateValue.current + ? value.value - minTranslateValue.current + : 0; props?.onChange?.(correctedValue, actionSheetHeight.current); if (drawUnderStatusBar) { if (lock.current) return; @@ -767,9 +769,9 @@ export default forwardRef( ? {enabled: false} : ({ onBegan: () => { - if (Platform.OS === 'android') { - scrollable(false); - } + // if (Platform.OS === 'android') { + // scrollable(false); + // } }, onGestureEvent(event) { if (sheetId && !isRenderedOnTop(sheetId, currentContext)) return;