Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/hooks/useGestureEventsHandlersDefault.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ type GestureEventContextType = {
isScrollablePositionLocked: boolean;
};

const dismissKeyboardOnJs = runOnJS(Keyboard.dismiss);

export const useGestureEventsHandlersDefault: GestureEventsHandlersHookType =
() => {
Expand Down Expand Up @@ -298,7 +297,7 @@ export const useGestureEventsHandlersDefault: GestureEventsHandlersHookType =
absoluteY > WINDOW_HEIGHT - animatedKeyboardHeight.value
)
) {
dismissKeyboardOnJs();
runOnJS(Keyboard.dismiss);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will crash with reanimated > 3.x. My recommendation -> 94cf11e

Copy link
Contributor Author

@beqramo beqramo May 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
I haven't tested on V3.
So it means we need to bump the required reanimated version on this lib?
Or what is your suggestion?
That way it crashes on reanimated < 3.x

Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update:
I tested on "react-native-reanimated": "~3.1.0" and it works perfectly

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just tested in "react-native-reanimated": "3.1.0".

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes exactly, that is a fix that this PR has.
That was the cause of the issue.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried this, but got this error now ReanimatedError: Trying to access property dismiss of an object which cannot be sent to the UI runtime., js engine: reanimated

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried this, but got this error now ReanimatedError: Trying to access property dismiss of an object which cannot be sent to the UI runtime., js engine: reanimated

Same

Copy link

@vanenshi vanenshi May 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like this works without problem (@LuisRego)

const dismissKeyboard = () => {
  Keyboard.dismiss()
}

...

runOnJS(dismissKeyboard)();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
}

Expand Down