Skip to content

fix(popover): blur translucent popover in chromium - #27484

Merged
liamdebeasi merged 8 commits into
mainfrom
FW-4130
May 18, 2023
Merged

liamdebeasi merged 8 commits into
mainfrom
FW-4130

Conversation

@mapsandapps

@mapsandapps mapsandapps commented May 15, 2023 •

Copy link
Copy Markdown
Contributor

Issue number: Resolves #22176


What is the current behavior?

Translucent popovers do not get blurred in Chromium

What is the new behavior?

  • Translucent popover gets blurred in Chromium

Note: existing screenshot tests nicely show the change in behavior.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Because of the existing, apparently intentional behavior in Chromium browsers with backdrop-filter and animation, we need to either animate the arrow and content instead of the wrapper or apply the filter to a different element. Here, I've animated the arrow and content instead of the wrapper.

The fix only needs to apply in ios mode. The translucent option is not supported in md mode.

@bolt-new-by-stackblitz

Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@github-actions github-actions Bot added the package: core @ionic/core package label May 15, 2023
@mapsandapps
mapsandapps marked this pull request as ready for review May 16, 2023 20:49
@mapsandapps
mapsandapps requested a review from a team as a code owner May 16, 2023 20:49
@mapsandapps
mapsandapps marked this pull request as draft May 16, 2023 21:42
@mapsandapps
mapsandapps marked this pull request as ready for review May 16, 2023 23:50

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.

It looks like the backdrop filter still does not work on the arrow element. The arrow diff is so small that I'd be fine moving forward with this fix as-is since it does noticeably improve the popover experience even without Chrome respecting the backdrop filter on the arrow. However, we should create a tech debt ticket to track this.

Fixing the arrow requires animating the pseudo element instead of the parent element. You can test this by doing the following (hacky code):

  1. Apply opacity: 0 from .popover-arrow::after instead of .popover-arrow in popover.ios.scss.
  2. Add pseudoElement: element.classList.contains('popover-arrow') ? '::after' : undefined to the object passed to element.animate in the initializeWebAnimation function in src/utils/animation/animation.ts.

@mapsandapps
mapsandapps added this pull request to the merge queue May 17, 2023
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks May 17, 2023
@liamdebeasi
liamdebeasi added this pull request to the merge queue May 18, 2023
Merged via the queue into main with commit a59eefb May 18, 2023
@liamdebeasi
liamdebeasi deleted the FW-4130 branch May 18, 2023 13:17
brandyscarney pushed a commit that referenced this pull request May 22, 2023
Issue number: Resolves #22176

---------

<!-- Please do not submit updates to dependencies unless it fixes an
issue. -->

<!-- Please try to limit your pull request to one type (bugfix, feature,
etc). Submit multiple pull requests if needed. -->

## What is the current behavior?
<!-- Please describe the current behavior that you are modifying. -->
Translucent popovers do not get blurred in Chromium

## What is the new behavior?
<!-- Please describe the behavior or changes that are being added by
this PR. -->

- Translucent popover gets blurred in Chromium

Note: existing screenshot tests nicely show the change in behavior.

## Does this introduce a breaking change?

- [ ] Yes
- [x] No

<!-- If this introduces a breaking change, please describe the impact
and migration path for existing applications below. -->


## Other information 

Because of the [existing, apparently
intentional](https://bugs.chromium.org/p/chromium/issues/detail?id=1148826)
behavior in Chromium browsers with `backdrop-filter` and animation, we
need to either animate the arrow and content instead of the wrapper or
apply the filter to a different element. Here, I've animated the arrow
and content instead of the wrapper.

The fix only needs to apply in `ios` mode. The translucent option is not
supported in `md` mode.

<!-- Any other information that is important to this PR such as
screenshots of how the component looks before and after the change. -->

---------

Co-authored-by: ionitron <[email protected]>
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: chromium issue with translucent popover

3 participants