From 235466fef552f2cf7cbbafb06029cdd879624606 Mon Sep 17 00:00:00 2001 From: beka <40486471+beqramo@users.noreply.github.com> Date: Sun, 4 Jun 2023 15:36:15 +0100 Subject: [PATCH] fix: crash on swipe down (#1367)(by @beqramo) * fix: crash on swipe down * fix: keyboard dismiss on JS thread * fix: call the keyboard dismiss method --------- Co-authored-by: Mo Gorhom --- src/hooks/useGestureEventsHandlersDefault.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/useGestureEventsHandlersDefault.tsx b/src/hooks/useGestureEventsHandlersDefault.tsx index a0b759ca8..43b7ee876 100644 --- a/src/hooks/useGestureEventsHandlersDefault.tsx +++ b/src/hooks/useGestureEventsHandlersDefault.tsx @@ -21,7 +21,7 @@ type GestureEventContextType = { isScrollablePositionLocked: boolean; }; -const dismissKeyboardOnJs = runOnJS(Keyboard.dismiss); +const dismissKeyboard = Keyboard.dismiss export const useGestureEventsHandlersDefault: GestureEventsHandlersHookType = () => { @@ -298,7 +298,7 @@ export const useGestureEventsHandlersDefault: GestureEventsHandlersHookType = absoluteY > WINDOW_HEIGHT - animatedKeyboardHeight.value ) ) { - dismissKeyboardOnJs(); + runOnJS(dismissKeyboard)(); } }