gorhom / react-native-bottom-sheet

A performant interactive bottom sheet with fully configurable options 🚀
https://gorhom.dev/react-native-bottom-sheet/
MIT License
7k stars 765 forks source link

[Bug] [iOS]: Rotating to landscape before entering a screen with the bottom sheet will cause the keyboard to cover the text input #2025

Open mheddomagic opened 3 days ago

mheddomagic commented 3 days ago

Version

v5

Reanimated Version

v3

Gesture Handler Version

v2

Platforms

iOS

What happened?

It would seem that the logic featuring the orientation of the device is flawed. When outside the screen containing the bottom sheet, if you change orientation of the device (ex. enter app in portrait mode on tablet, then rotate to landscape), when you focus into the BottomSheetTextInput, the bottom sheet doesn't push up to the correct heigh as it should. This leads the keyboard to cover the text input and bottom sheet.

I suspect this issue is related to https://github.com/gorhom/react-native-bottom-sheet/issues/1279 , and that the issue is the use of Dimensions.get('window'); instead of useWindowDimensions(); , but I am uncertain. On the Dimensions.get('window'); page it recommends to use useWindowDimensions() anyways, so maybe it's worth considering regardless? 🤷

A video of the code provided in expo, but on my iOS Simulator

https://github.com/user-attachments/assets/b1889c63-ab01-4582-8ab3-e99c6a94fd8b

Reproduction steps

Reproduction sample

https://snack.expo.dev/@mheddomagic/bottom-sheet---rotating-issue

Relevant log output

No response

adrianv-synergy commented 2 hours ago

Same problem here too. Thanks for the 1279 reference. Seems like it's the culprit. That's our current patch which works better.

@gorhom+bottom-sheet+5.0.5.patch