Website: Replace 100vh with 100dvh to fix an "unscrollable" state on mobile devices #1883
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On iPhones, 100vh may exceed the actual viewport size – Safari viewport height varies as you scroll the page and
vh
seems to represent the largest possible viewport.When opening an anchor link (/
#wp-admin
), the browser wants to scroll down and align the top of the screen with the WordPress site. This causes Playground to occasionally end up in a slightly scrolled state where only the WordPress site is visible and you cannot scroll back to the Playground address bar:Why? Because:
100vh
makes the page longer than it needs to beSolution: Use
dvh
unitThere's a special
dvh
unit that represents the current height of the viewport:Testing Instructions (or ideally a Blueprint)
cc @annziel this might interest you