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

refactor: refactored the snap points reactions and improve snapping sequencing #1784

Merged
merged 4 commits into from
Apr 21, 2024

Conversation

gorhom
Copy link
Owner

@gorhom gorhom commented Apr 1, 2024

Motivation

This PR introduces a fully rewritten snap points reactions handler which stabilised the snapping sequencing when multiple events trigger the snap mechanism.

The new handler insures that snap points changes does not block keyboard or any other triggers but to respect them and re-evaluate the bottom sheet position accordingly.

Use cases

This PR should fix

  • on mount animation while parent container is resizing
  • on mount animation with text input is auto focus
  • resizing snap points
  • resizing content
  • other more
Preview
Screen.Recording.2024-04-01.at.23.42.32.mov

@gorhom gorhom added the v5 label Apr 1, 2024
@x43n
Copy link

x43n commented Apr 3, 2024

Looks great! Will it be possible to keep the keyboard open and input focused while updating the snap points with the drag handler? Like reddit/slack text input. Currently trying to do that with v5.alpha.9 but struggling to get it working.

@mjvestal
Copy link

mjvestal commented Apr 5, 2024

This PR fixes the issues I've found with adopting the 5.0.0-alpha.9 release in my React Native 0.72 app. Specifically with this PR applied I no longer see

  • Sometimes a bottom sheet with only a focused text area is opens behind the keyboard
  • Sometimes a bottom sheet opens to the wrong height

Great job!

@gorhom gorhom merged commit 697f7b7 into v5 Apr 21, 2024
@gorhom gorhom deleted the refactor/refactor-snap-points-reactions branch April 21, 2024 16:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants