-
-
Notifications
You must be signed in to change notification settings - Fork 783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix reanimated freezing Keyboard module #1346
Conversation
Duplicate #1354? |
I think so, just slightly different fixes |
@gorhom When can we expect this to be merged? |
thanks @janicduplessis @SamuelScheit for submitting CRs to address this issue |
…anicduplessis) * Fix reanimated freezing Keyboard module
@janicduplessis still gives the same error for me? |
yeah same -- still crashes on 4.4.6.
-const dismissKeyboardOnJs = runOnJS(Keyboard.dismiss);
export const useGestureEventsHandlersDefault: GestureEventsHandlersHookType =
() => {
@@ -46,6 +45,13 @@ export const useGestureEventsHandlersDefault: GestureEventsHandlersHookType =
} = useBottomSheetInternal();
//#endregion
+ // Fixed in v5 -- see:
+ // https://github.com/software-mansion/react-native-reanimated/issues/4201
+ // https://github.com/gorhom/react-native-bottom-sheet/pull/1354
+ const dismissKeyboard = () => {
+ Keyboard.dismiss();
+ }
+
//#region gesture methods
const handleOnStart: GestureEventHandlerCallbackType<GestureEventContextType> =
useWorkletCallback(
@@ -298,7 +304,7 @@ export const useGestureEventsHandlersDefault: GestureEventsHandlersHookType =
absoluteY > WINDOW_HEIGHT - animatedKeyboardHeight.value
)
) {
- dismissKeyboardOnJs();
+ runOnJS(dismissKeyboard)();
}
} |
Still getting the error on 4.4.6. I've got : "react-native-reanimated": "~2.14.4" and "@gorhom/bottom-sheet": "^4.4.6". |
This fix seems to have broken the drag to dismiss functionality of Works: Doesn't work: The same is true for the alpha version of the library (5.0.0-alpha.1). |
Why has this issue been closed? The problem still exists. |
@ansh this is pull request and it was merged. You can't reopen same pull request. If the problem still exists, you should open an issue. |
fix: crash on swipe down (gorhom#1367)
Motivation
Reanimated captures and freezes the whole Keyboard module since we reference it from a worklet. To avoid this we can create the function only once at the top of the module from the JS context. This seems to happen only with reanimated v3.