Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue number: resolves #31337
What is the current behavior?
Currently,
ion-contentcaches its fullscreen offsets and only recomputes them on load, awindowresize,ionTabBarLoaded, orrecalculateDimensions(). A change to--ion-safe-area-topfires none of those, so on Android edge-to-edge, where the real inset only arrives once the native WindowInsets callback has run, the fullscreen scroll region and#background-contentstay short by the inset and leave a gap behind a translucent header. Sheet modals have the same problem:--ion-modal-offset-topis a resolved pixel value written at present time, so a sheet presented before the inset is known stays too tall.What is the new behavior?
Fullscreen
ion-contentnow observes its own box with aResizeObserver, which works because the content flexes to fill whatever space the headers and footers leave behind. The callback keeps theoffsetParent === nullguard fromonResize(), since a hidden page reports a 0x0 box and recomputing then would zero the offsets, but it skips that method's 100ms debounce, which left the offsets visibly wrong for a small amount of time. Sheet modals subscribe toonRootSafeAreaTopChange(), a hidden probe element whoseheighttracksvar(--ion-safe-area-top)so a change to the variable becomes an observable size change.Does this introduce a breaking change?
Other information
The preview pages won't show the bug on their own, since it needs the inset to change after load. Run
document.documentElement.style.setProperty('--ion-safe-area-top', '24px')in the console to trigger it.