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: non-zero duration for resize animation #1497

Closed
wants to merge 1 commit into from

Conversation

emilioschepis
Copy link

Motivation

When the user focuses a text input, either inside or outside a bottom sheet modal, the container resizes on Android.

Starting with Reanimated v3, if the modal itself is shorter than the keyboard, the resize animation causes the whole sheet to call disappear. This happens both in v4 and v5-alpha.3.

To be more specific, using Reanimated v3 this code evaluates to true for a moment and the sheet closes.

I introduced a 1ms delay in the resize animation, which solves this issue. I am not completely sure on the exact reason, considering that the difference is most likely in the Reanimated source.

This PR fixes #1356.

Using Reanimated 3, this resize animation with duration 0
causes the bottom sheet modal to disappear.

Refs: gorhom#1356
@github-actions
Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@t-bonfill
Copy link

Hi ! Same issue on my project!
I have to use patch-package with emilioschepis's solution until this PR is merged.

@github-actions
Copy link

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@emilioschepis
Copy link
Author

This is not stale, I believe the issue is still valid and this is the only workaround I could come up with.

@gorhom let me know if this is the right approach, we've been using this patch in production for over a month and we haven't noticed any issues.

Copy link

github-actions bot commented Dec 2, 2023

This PR is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@sondreluc
Copy link

Not stale.
@gorhom It would be nice if you could look at this and determine if this is an acceptable fix or not.
See #1356 (comment) for a detailed investigation into the issue it solves.

@gorhom
Copy link
Owner

gorhom commented Jan 1, 2024

thanks @emilioschepis for submitting this PR, i have fixed this issue with this PR #1675

@gorhom gorhom closed this Jan 1, 2024
@emilioschepis
Copy link
Author

Hey @gorhom perfect, thank you!

diegolmello added a commit to RocketChat/Rocket.Chat.ReactNative that referenced this pull request Aug 27, 2024
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.

[v5] [v4] Android keyboard issue in combination with Reanimated 3
4 participants