Skip to content

fix(modal): remove safe-area gap and flash in fullscreen modals#31092

Open
ShaneK wants to merge 4 commits intomainfrom
FW-7136
Open

fix(modal): remove safe-area gap and flash in fullscreen modals#31092
ShaneK wants to merge 4 commits intomainfrom
FW-7136

Conversation

@ShaneK
Copy link
Copy Markdown
Member

@ShaneK ShaneK commented Apr 22, 2026

Issue number: resolves #31015


What is the current behavior?

Fullscreen modals without an ion-footer set height and padding-bottom on .modal-wrapper to reserve space for the bottom safe-area. Because ion-content's background does not extend into that wrapper padding, a visible gap appears between the content and the bottom edge of the modal.

Separately, modals that declare custom --width and --height on phone viewports flash inherited safe-area values while animating in, then snap to 0px once the post-animation position correction runs.

What is the new behavior?

Bottom safe-area compensation now happens inside ion-content instead of on the wrapper, so the modal background stays edge-to-edge.

  • New internal --ion-content-safe-area-padding-bottom CSS property is added to .inner-scroll's padding-bottom calc.
  • modal.tsx sets that property on ion-content for fullscreen modals without a footer, and clears it on resize and dismiss.
  • Wrapper no longer has height or padding-bottom inline styles written to it.
  • New hasCustomModalDimensions() helper detects modals that override both --width and --height to non-fullscreen values. These are zeroed from the initial safe-area prediction so there is no flash before the post-animation correction.
  • Extracted findContentAndFooter() and applyFullscreenSafeAreaTo() helpers so the resize handler and initial apply share the same lookup.
  • E2E tests cover scroll-padding placement, wrapper content area remaining full viewport height, .inner-scroll padding including safe-area, and custom-dimension modals starting at zero.

Does this introduce a breaking change?

  • Yes
  • No

Other information

--ion-content-safe-area-padding-bottom is an internal property. It is additive with the existing --padding-bottom consumers can set, and it only takes effect when modal.tsx writes it on fullscreen modals without a footer.

Example pages:

Example iOS card modal safe-area:

Dev Build:

8.8.5-dev.11776879142.101200b9

@ShaneK ShaneK requested a review from a team as a code owner April 22, 2026 13:31
@ShaneK ShaneK requested a review from brandyscarney April 22, 2026 13:31
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 22, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ionic-framework Ready Ready Preview, Comment Apr 22, 2026 5:36pm

Request Review

Copy link
Copy Markdown
Contributor

@thetaPC thetaPC left a comment

Choose a reason for hiding this comment

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

LGTM, minor suggestion

testInfo.annotations.push({
type: 'issue',
description: 'https://github.com/ionic-team/ionic-framework/issues/30900',
description: 'https://github.com/ionic-team/ionic-framework/issues/31015',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why was the issue changed?

}

/**
* Sets --ion-content-safe-area-padding-bottom on the given ion-content
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Correct me if I'm wrong but it seems that --ion-content-safe-area-padding-bottom is a a new variable to the project? If that's the case, can we comment that it's meant for internal usages and when to use it.

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)

2 participants