-
-
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: non-zero duration for resize animation #1497
Conversation
Using Reanimated 3, this resize animation with duration 0 causes the bottom sheet modal to disappear. Refs: gorhom#1356
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. |
Hi ! Same issue on my project! |
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. |
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. |
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. |
Not stale. |
thanks @emilioschepis for submitting this PR, i have fixed this issue with this PR #1675 |
Hey @gorhom perfect, thank you! |
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.