Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Update web index.html height style #3199

Merged
merged 1 commit into from
Feb 9, 2021
Merged

Conversation

joamartico
Copy link
Contributor

@joamartico joamartico commented Feb 8, 2021

Why

Fixed the screen height in the web when the statusBar is transparent. Before this change, in the web was displayed an extra white space in the bottom of the screen.

Test Plan

It works perfectly with react-navigation bottom tabs and header, and also with SafeArea component:
image

Landscape mode:
image

In iPhone 6/7/8 works normally:
image

Fixed the screen height in the web when the statusBar is transparent. Before this change, in the web was displayed an extra white space in the bottom of the screen.
@@ -40,7 +40,7 @@
scroll-behavior: smooth;
/* Prevent text size change on orientation change https://gist.github.com/tfausak/2222823#file-ios-8-web-app-html-L138 */
-webkit-text-size-adjust: 100%;
height: 100%;
height: calc(100% + env(safe-area-inset-top));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, interesting idea. Have you tested this behavior with react-native-safe-area-context (react-navigation), landscape mode on iOS (resizing header bar)? Could you please add a "test plan" to your PR description:

# Test Plan

...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it works! I added screenshots to the test plan showing the behavior with react-navigation bottom tabs and header, with SafeArea component and with landscape mode.

@EvanBacon EvanBacon added the Platform: web Using Expo in the browser label Feb 9, 2021
@EvanBacon EvanBacon changed the title Update web index.html Update web index.html height style Feb 9, 2021
Copy link
Contributor

@EvanBacon EvanBacon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested this on iOS Safari, iOS PWA (with status bar and without), Chrome Android, Android PWA, and desktop Chrome. It appears to work reliably. I think this mostly effects iOS PWAs with translucent status bars (fixing a known bug where the height didn't resize properly).

@EvanBacon EvanBacon merged commit ac37078 into expo:master Feb 9, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Platform: web Using Expo in the browser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants