Skip to content

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

Closed
@mheddomagic

Description

@mheddomagic

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions