Skip to content

bug(bottomSheet): collision with CSS Filter on Chrome #30774

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
godind opened this issue Apr 2, 2025 · 1 comment · Fixed by #30840
Closed
1 task done

bug(bottomSheet): collision with CSS Filter on Chrome #30774

godind opened this issue Apr 2, 2025 · 1 comment · Fixed by #30840
Assignees
Labels
area: material/bottom-sheet P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@godind
Copy link

godind commented Apr 2, 2025

Is this a regression?

  • Yes, this behavior used to work in the previous version

The previous version in which this bug was not present was

18

Description

After v19.2.4 upgrade, I have a resize/flicker while the bottomSheet slides into view. I've mange to narrow it down the css filters when they are applied to html or body element causing the issue. With css filters present on Chrome, when the BottomSheet appear, it resizes the view instead of sliding into view.

To reproduce: ng new filteproject. ng add @angular/material . Following the Material io example and add a BottomSheet and open button to the default project page.

Add backdrop-filter: brightness(1); to styles.css body

body { margin: 0; font-family: Roboto, "Helvetica Neue", sans-serif; backdrop-filter: brightness(1); }

Trigger the bottomshett and you will a page flicker on Chrome. It works fine in Safari and worked fine in Angular 18 on Chrome.

If you add a DIV between body and app-root, and apply filters to it, the issue goes away. but BottomSheet and dialog are not affected by the filters anymore. I use filters to create dim the entire document or as a night mode feature.

Looks like its an overlay context issue or something. Not experienced enough to explain it better !

Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-bapgtgzq?file=src%2Fapp%2Fapp.component.html
Steps to reproduce:

  1. Click Open File button

Expected Behavior

The BottomSheet should slide into view from the bottom.

Actual Behavior

BottomSheet is added to the bottom of body but is visible right away. It then slides over body and resizes the page as it moves to it final position.

Environment

Angular CLI: 19.2.5
Node: 18.20.7
Package Manager: npm 10.8.2
OS: darwin arm64

Angular: 19.2.4
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package Version

@angular-devkit/architect 0.1902.5
@angular-devkit/build-angular 19.2.5
@angular-devkit/core 19.2.5
@angular-devkit/schematics 19.2.5
@angular/cdk 19.2.7
@angular/cli 19.2.5
@angular/material 19.2.7
@schematics/angular 19.2.5
ng-packagr 19.2.0
rxjs 7.8.2
typescript 5.8.2
zone.js 0.15.0

bottomsheetFlicker.mov
@godind godind added the needs triage This issue needs to be triaged by the team label Apr 2, 2025
crisbeto added a commit to crisbeto/material2 that referenced this issue Apr 10, 2025
The bottom sheet has an animation where it starts off-screen and animates in. At the same time it moves focus into itself. It seems like under certain conditions (e.g. having `backdrop-filter` on the `body`) this causes the entire page the jump in a jarring way due to the focus being moved.

These changes resolve the issue by telling the browser not to scroll the page when moving focus.

Fixes angular#30774.
@crisbeto crisbeto self-assigned this Apr 10, 2025
@crisbeto crisbeto added P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent area: material/bottom-sheet and removed needs triage This issue needs to be triaged by the team labels Apr 10, 2025
crisbeto added a commit that referenced this issue Apr 11, 2025
#30840)

The bottom sheet has an animation where it starts off-screen and animates in. At the same time it moves focus into itself. It seems like under certain conditions (e.g. having `backdrop-filter` on the `body`) this causes the entire page the jump in a jarring way due to the focus being moved.

These changes resolve the issue by telling the browser not to scroll the page when moving focus.

Fixes #30774.

(cherry picked from commit 5dcbba7)
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators May 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: material/bottom-sheet P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants