Skip to content

fix(modal): prevent double safe-area in fullscreen modals with ion-content (#31015)#31051

Open
Vitalcheffe wants to merge 1 commit intoionic-team:mainfrom
Vitalcheffe:fix/fullscreen-modal-double-safearea-31015
Open

fix(modal): prevent double safe-area in fullscreen modals with ion-content (#31015)#31051
Vitalcheffe wants to merge 1 commit intoionic-team:mainfrom
Vitalcheffe:fix/fullscreen-modal-double-safearea-31015

Conversation

@Vitalcheffe
Copy link
Copy Markdown

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 the white gap regression for the common pattern: modals with ion-content and no ion-footer
  • Preserves safe-area handling for custom modals without ion-content
  • No breaking changes to existing ion-footer behavior

Fixes #31015

…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 Vitalcheffe requested a review from a team as a code owner March 30, 2026 22:44
@Vitalcheffe Vitalcheffe requested a review from gnbm March 30, 2026 22:44
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 30, 2026

@Vitalcheffe is attempting to deploy a commit to the Ionic Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added the package: core @ionic/core package label Mar 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

package: core @ionic/core package

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: applyFullscreenSafeArea() shrinks fullscreen modal wrapper when ion-content exists without ion-footer (8.8.1 regression)

1 participant