fix(modal): prevent double safe-area in fullscreen modals with ion-content (#31015)#31051
Open
Vitalcheffe wants to merge 1 commit intoionic-team:mainfrom
Open
Conversation
…ntent applyFullscreenSafeArea() was applying wrapper-level padding-bottom for modals with ion-content but no ion-footer. Since ion-content already handles bottom safe-area internally via its scroll container, this created double compensation — visible as a white gap at the bottom of fullscreen modals on iOS devices with home indicators. Fix: skip wrapper padding when ion-content is present, since it already manages its own safe-area insets. Only apply wrapper padding for custom modals with raw HTML that lack ion-content. Fixes ionic-team#31015
|
@Vitalcheffe is attempting to deploy a commit to the Ionic Team on Vercel. A member of the Team first needs to authorize it. |
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.
Problem
After upgrading from @ionic/angular 8.7.17 to 8.8.1, fullscreen modals with ion-content but no ion-footer display a white gap at the bottom on iOS devices with a home indicator.
This is a regression from PR #30949, which added applyFullscreenSafeArea(). The function applies wrapper-level padding-bottom for modals with ion-content and no ion-footer. However, ion-content already handles bottom safe-area internally via its scroll container, creating double compensation.
Root cause
The condition "if (!hasContent || hasFooter) return" means padding is applied when hasContent && !hasFooter. But ion-content already manages its own safe-area insets, so the wrapper-level padding creates an extra offset.
Fix
Changed the condition to "if (hasContent || hasFooter) return" — skip wrapper padding when ion-content is present (it handles safe area internally) or when ion-footer is present (it handles its own padding). Only apply wrapper padding for custom modals with raw HTML that lack both.
Impact
Fixes #31015