From 5e8a4b015f0f429d66433504b250cf0250bfa6ff Mon Sep 17 00:00:00 2001 From: Gunnar Torfi Date: Thu, 19 Sep 2024 08:50:45 +0000 Subject: [PATCH] fix: android action onclick --- src/gestures.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gestures.tsx b/src/gestures.tsx index b7c4312..1cc2e8f 100644 --- a/src/gestures.tsx +++ b/src/gestures.tsx @@ -82,6 +82,13 @@ export const ToastSwipeHandler: React.FC< const threshold = direction === 'left' ? -WINDOW_WIDTH * 0.25 : -16; const shouldDismiss = translate.value < threshold; + if (Math.abs(translate.value) < 16) { + translate.value = withTiming(0, { + easing: Easing.elastic(0.8), + }); + return; + } + if (shouldDismiss) { translate.value = withTiming( -WINDOW_WIDTH,