Skip to content

fix(modal): allow backdrop-filter inside md modal - #31682

Open
shkomg wants to merge 1 commit into
ionic-team:mainfrom
userstoriesbot-showcase:fix/md-modal-backdrop-filter
Open

shkomg wants to merge 1 commit into
ionic-team:mainfrom
userstoriesbot-showcase:fix/md-modal-backdrop-filter

Conversation

@shkomg

@shkomg shkomg commented Nov 2, 2026

Copy link
Copy Markdown

Issue number: part of #31603 (regular md modals; the sheet case stays open)


What is the current behavior?

In md mode the modal's enter animation stays applied to .modal-wrapper until the modal is dismissed (default both fill, kept alive by the overlay). Since it animates opacity, Chromium treats the wrapper as a backdrop root, so backdrop-filter on content inside the modal only sees the modal itself and blurs nothing.

What is the new behavior?

  • The md wrapper enter animation uses a backwards fill and sets its end state (opacity: 1, translateY(0px)) with afterStyles, so nothing stays applied to the wrapper once it has finished. The modal looks the same: the modal screenshot tests gave identical results with and without the change in a local run.
  • backdrop-filter inside a regular md modal now blurs the page behind it, as it already does in ios.
  • Added a test in modal/test/animations that checks the md wrapper has no animations left after ionModalDidPresent and ends at full opacity with no offset.

Sheet modals have the same problem in both modes through the sheet enter animation, which the gesture drives afterwards. I left those alone to keep this small.

Does this introduce a breaking change?

  • Yes
  • No

Other information

The video shows a transparent md modal with a backdrop-filter: blur(12px) card over a striped page, first with sharp stripes behind the card and then blurred with this change.

ionic.mp4

The run starts the app from this branch and opens the modal from a small test page with a striped background, then holds on the card. It is an automated browser run, so the cursor is drawn on top.

Fix written with Claude Code; video is an automated browser run of this branch recorded by User Stories Bot.

The md enter animation stayed applied to `.modal-wrapper` after it
finished, because it used the default `both` fill and the overlay keeps
the animation until dismiss. An element with an applied opacity
animation is a backdrop root in Chromium, so `backdrop-filter` on
content inside the modal could only see the modal itself and blurred
nothing.

The wrapper animation now uses a `backwards` fill and sets its end
state (opacity 1, no offset) as inline styles when it finishes, so the
modal looks the same but the finished animation is no longer applied.
@shkomg
shkomg requested a review from a team as a code owner November 2, 2026 23:23
@shkomg
shkomg requested a review from brandyscarney November 2, 2026 23:23
@vercel

vercel Bot commented Nov 2, 2026

Copy link
Copy Markdown

@shkomg 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 Nov 2, 2026

This branch has not been deployed

No deployments
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.

1 participant