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

[v4] screen resize events triggering animatedIndex change #1415

Closed
jspizziri opened this issue Jun 24, 2023 · 1 comment
Closed

[v4] screen resize events triggering animatedIndex change #1415

jspizziri opened this issue Jun 24, 2023 · 1 comment
Labels

Comments

@jspizziri
Copy link

Bug

When a resize event occurs such as a screen rotation (in native) or a window resize (in web) the bottom sheet index can change suddenly. This seems to be due to animatedContainerHeight being used in the calculation of animatedIndex.

Environment info

Library Version
@gorhom/bottom-sheet 4.4.7
react-native 0.71.6
react-native-reanimated ^2.6.0
react-native-gesture-handler ^2.4.2

Steps To Reproduce

Web

  1. Open the bottom sheet.
  2. Resize the window.

Mobile
I haven't tested this on mobile but theoretically it should happen there too.

  1. Open the bottom sheet.
  2. Rotate the device (triggering a change in the screen dimensions)

Describe what you expected to happen:

A window/screen resize should not result in a change in the animatedIndex

Notes

I've done a little exploration on fixing this but I'm not super happy with any of my approaches or results. I've effectively tried to set a property in the component when a resize reaction takes place and then adding a conditional to check if a resize event is the responsible for triggering a recalc on the animatedIndex property.

If I could get some direction from someone who knows more about the library and the best path forward I'd happily do the implementation and submit a PR!

@jspizziri jspizziri added the bug Something isn't working label Jun 24, 2023
@github-actions
Copy link

@jspizziri: hello! 👋

This issue is being automatically closed because it does not follow the issue template.

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

No branches or pull requests

1 participant