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

[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 this issue Nov 4, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@mheddomagic
Copy link

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 #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

Simulator.Screen.Recording.-.iPad.Pro.12.9-inch.6th.generation.-.2024-11-04.at.16.15.28.mp4

Reproduction steps

  • I found it's easiest to reproduce when using a iPad. Start the app in portrait mode
  • Have code with 2 screens, the first with no bottom sheet, the second with a bottom sheet featuring a BottomSheetTextInput
  • In the 1st screen rotate the device to landscape before navigating to the 2nd screen that has the bottom sheet
  • Open the bottom sheet as normal
  • Focus into the bottom sheet text input
    Result -> The keyboard covers the text input, almost like the bottom sheet isn't pushing up enough

Reproduction sample

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

Relevant log output

No response

@mheddomagic mheddomagic added the bug Something isn't working label Nov 4, 2024
@adrianv-synergy
Copy link

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

Copy link

github-actions bot commented Dec 9, 2024

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

@mheddomagic
Copy link
Author

Not stale, and I can confirm that the patch suggested by @adrianv-synergy above works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants