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

Dimensions.get('window').height still returns wrong height on Android with notch #36447

Closed
iway1 opened this issue Mar 11, 2023 · 4 comments
Closed
Labels
API: Dimensions Needs: Triage 🔍 Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@iway1
Copy link

iway1 commented Mar 11, 2023

Description

As described in #23693, useWindowDimensions and Dimension.get('window').height can return the wrong value on android devices with a notch.

This can lead to unexpected behavior and cause device specific layout issues on Android React Native apps.

React Native Version

0.71.4

Output of npx react-native info

System:
OS: macOS 13.2.1
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 117.25 MB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.16.0 - /usr/local/bin/node
Yarn: 1.22.15 - /usr/local/bin/yarn
npm: 8.11.0 - /usr/local/bin/npm
Watchman: 2022.11.07.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.11.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 22.2, iOS 16.2, macOS 13.1, tvOS 16.1, watchOS 9.1
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 14.2/14C18 - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: Not Found
react-native: Not Found
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Steps to reproduce

See #23693.

  1. Call Dimensions.get('window').height on android devices with a notch.
  2. Note that the returned screen height value is not the height of the window

Snack, code example, screenshot, or link to a repository

https://snack.expo.dev/@iway1/carefree-popsicle

@brandonfonseca
Copy link

This needs to be fixed. This is core functionality for any mobile library. Please prioritize this RN team!!

@github-actions
Copy link

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

@github-actions github-actions bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Oct 13, 2023
Copy link

github-actions bot commented Nov 7, 2023

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Nov 7, 2023
@Panda-ref
Copy link

Still an issue on react-native@0.72.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API: Dimensions Needs: Triage 🔍 Platform: Android Android applications. Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

4 participants