Skip to content
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: crash on swipe down #1367

Merged
merged 3 commits into from
Jun 4, 2023
Merged

Conversation

beqramo
Copy link
Contributor

@beqramo beqramo commented May 11, 2023

this PR fixes the issue faced here:
#1366

Motivation

keyboard close was being called incorrectly which was causing a crash on the device.
This fix was tested on device

@@ -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.

@beqramo
Copy link
Contributor Author

beqramo commented Jun 2, 2023

Hi Guys,
I'm on reanimated ~3.1.0.

Update/Edit:
I was able to run 3.2.0.
Just noticed that on a patch file locally, I had a different way of the fix :).
I'm pushing the correct variant.

Please take a look
Thanks

@gorhom gorhom merged commit 235466f into gorhom:master Jun 4, 2023
@gorhom
Copy link
Owner

gorhom commented Jun 4, 2023

thanks @beqramo for submitting this CR , i will prepare a new patch release today with this fix <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants