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(BottomSheetTextInput): reset shouldHandleKeyboardEvents on unmount #1495

Conversation

koplyarov
Copy link
Contributor

This pull-request resets shouldHandleKeyboardEvents flag on BottomSheetTextInput unmount

Motivation

For my project, I'm using a system where I'm reusing a single BottomSheet and I'm mounting and unmounting the content (can be different) as it opens and closes.

This approach triggers the following issue: often, when I unmount the content of the BottomSheet and a BottomSheetTextInput is focused, the blur event doesn't get handled at all, and this causes the BottomSheet to show up whenever I open a keyboard from an unrelated place.

The fix is simple: I just reset the flag whenever an unmount happens.

Before

Screen.Recording.2023-08-23.at.20.54.33.mov

After

Screen.Recording.2023-08-23.at.20.55.45.mov

@gorhom gorhom added v4 Written in Reanimated v2 v5 labels Sep 6, 2023
@gorhom gorhom self-assigned this Sep 6, 2023
@gorhom gorhom merged commit 6a5034c into gorhom:master Sep 6, 2023
@gorhom
Copy link
Owner

gorhom commented Sep 6, 2023

thanks @koplyarov for submitting this PR, it should be released soon

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

Successfully merging this pull request may close these issues.

None yet

2 participants