Skip to content
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

Expansion panel FOUC when contained in dialog #13870

Closed
SamuelMS opened this issue Oct 30, 2018 · 37 comments · Fixed by #13888 or #24529
Closed

Expansion panel FOUC when contained in dialog #13870

SamuelMS opened this issue Oct 30, 2018 · 37 comments · Fixed by #13888 or #24529
Assignees
Labels
animation This issue is related to Angular animations or CSS animations area: material/dialog area: material/expansion P2 The issue is important to a large percentage of users, with a workaround

Comments

@SamuelMS
Copy link

I'm submitting a...


[x] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

Expansion panels currently render with a flash of unstyled content (FOUC) when nested in a dialog -- they always temporarily appear as expanded, regardless of what the "expanded" attribute is set to. After a moment, all expansion panels that have been explicitly set to closed collapse.

This only occurs in Angular / Material 7.

Expected behavior

Expansion panels should appear as collapsed when the dialog opens when expanded=false instead of briefly appearing as expanded, then collapsing after a delay.

Minimal reproduction of the problem with instructions

Click the button and note the flash of unstyled content in the dialog in Angular 7.

Angular 7 (bugged): https://angular-egzwfw.stackblitz.io
Angular 6 (correct): https://angular-eepzxs.stackblitz.io

What is the motivation / use case for changing the behavior?

Flashes of unstyled content are jarring and feel very buggy.

Environment


Angular version: 7.0.1
Material version: 7.0.2
TypeScript: 3.1.1


Browser:
- [x] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [x] Firefox version XX
- [x] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
@josephperrott josephperrott self-assigned this Oct 30, 2018
@josephperrott josephperrott added P4 A relatively minor issue that is not relevant to core functions animation This issue is related to Angular animations or CSS animations labels Oct 30, 2018
@crisbeto
Copy link
Member

Might potentially be solved by #11778.

@crisbeto
Copy link
Member

I tried it out and it doesn't look like it'll be fixed by #11778.

crisbeto added a commit to crisbeto/material2 that referenced this issue Oct 30, 2018
Currently the enter animations for the Material dialog, CDK dialog and bottom sheet are set up to be blocking, which means that any components with an initial animation inside them will be blocked until they're done. These changes allow for the child animations to run in parallel.

Fixes angular#13870.
@crisbeto crisbeto self-assigned this Oct 30, 2018
jelbourn pushed a commit that referenced this issue Nov 3, 2018
…13888)

Currently the enter animations for the Material dialog, CDK dialog and bottom sheet are set up to be blocking, which means that any components with an initial animation inside them will be blocked until they're done. These changes allow for the child animations to run in parallel.

Fixes #13870.
atscott pushed a commit to atscott/components that referenced this issue Nov 5, 2018
…ngular#13888)

Currently the enter animations for the Material dialog, CDK dialog and bottom sheet are set up to be blocking, which means that any components with an initial animation inside them will be blocked until they're done. These changes allow for the child animations to run in parallel.

Fixes angular#13870.
jelbourn pushed a commit that referenced this issue Nov 6, 2018
…13888)

Currently the enter animations for the Material dialog, CDK dialog and bottom sheet are set up to be blocking, which means that any components with an initial animation inside them will be blocked until they're done. These changes allow for the child animations to run in parallel.

Fixes #13870.
@josephperrott
Copy link
Member

Reopening as the fix was reverted.

This seems to be a larger issue across our library as our components use animations to set state quite frequently.

@crisbeto
Copy link
Member

@josephperrott I've opened #14127 which should fix the issue and avoid the presubmit issues.

@SamuelMS
Copy link
Author

SamuelMS commented Feb 5, 2019

@crisbeto @josephperrott Hate to be that guy, but has there been any traction on this issue since November? Looks like it might be blocked by a larger issue, per comments in the PR?

@ywager
Copy link

ywager commented Mar 5, 2019

Also encountered this problem

@StavM
Copy link

StavM commented Mar 6, 2019

Hope this issue gets the attention it deserves. definitely shouldn't be a "P4" priority.
this is probably one of the top reasons to stay with 6.4.7.

@BobBDE
Copy link

BobBDE commented Mar 12, 2019

Hi guys,

It's a workaround but you can use the lazy rendering of the expansion panel to prevent the animation ( with ng-template matExpansionPanelContent).

@ThomasTheJohnson
Copy link

ThomasTheJohnson commented Apr 8, 2019

@crisbeto @josephperrott, Is there a timeline for this fix being worked into a release? Asking so we know whether to move forward with workarounds or reworks.

@FONFAAS
Copy link

FONFAAS commented Apr 11, 2019

hello! is there an ETA on this?

@JoshuaAlzate
Copy link

Still persist on Angular Material 10.0.1

@mindscratch
Copy link

Still persist with Angular Material 11.0.x

@Akxe
Copy link

Akxe commented Jan 11, 2021

The skackblitz links in the issue are not opening. Here is mine for Angular v11 https://stackblitz.com/edit/components-issue-1fvgvm

@waseemw
Copy link

waseemw commented Jan 12, 2021

I'm still having this issue as well with Angular Material 11

@adarsh-thakur
Copy link

Another workaround is to disable all animations until ngAfterViewInit using the [@.disabled] property on a parent element.

https://stackblitz.com/edit/angular-issue13870-workaround

Thanks alot. You Saved the Day.

@liesahead
Copy link

liesahead commented Feb 15, 2021

I think the problem is inside dialog itself, because I noticed that all content is jumping when dialog is opening. To reproduce that you can open any dialog in angular material dialog example page. The content jumps a little. We have separated dialog header and footer (actions) and now content jumping became very noticeable. At first thought that there is a bug in our project, but then decided to check the material dialog example page.

Open this stackblitz:
https://stackblitz.com/angular/rogvlbmonba?file=src%2Fapp%2Fdialog-overview-example.ts

And now open dialog. You will notice how buttons are jumping a little. If you cannot - enable CPU throttling in devtools.

@Synzed
Copy link

Synzed commented Mar 16, 2021

Same thing happens with an expansion panel inside a mat-menu .. problem still persists

@VladislavKhlystun
Copy link

Still persist with Angular Material 12.0.x

@vgt-benjaminh
Copy link

vgt-benjaminh commented Dec 8, 2021

Also happens when the expansion panel is placed inside a stepper using Angular Material 11.2.13

@pranav-js
Copy link

give this issue some attention please. this is serious glitch and I spent so much time thinking I was doing something wrong! but it seems to be there since 2018!

@steffenhees
Copy link

If this is not fixed yet, please fix it!!! Thank you!!!

Had the same problem. With the workaround from @dcrouch79 it works for now. Thanks!

@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround and removed P4 A relatively minor issue that is not relevant to core functions labels Mar 6, 2022
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 6, 2022
Reworks several components that usually contain projected content not to block animations within that content. This prevents things like expansion panels from appearing as open.

These changes are identical to angular#13888 which had to be reverted in the past.

Fixes angular#13870.
crisbeto added a commit to crisbeto/material2 that referenced this issue Mar 6, 2022
Reworks several components that usually contain projected content not to block animations within that content. This prevents things like expansion panels from appearing as open.

These changes are identical to angular#13888 which had to be reverted in the past.

Fixes angular#13870.
crisbeto added a commit that referenced this issue Mar 6, 2022
Reworks several components that usually contain projected content not to block animations within that content. This prevents things like expansion panels from appearing as open.

These changes are identical to #13888 which had to be reverted in the past.

Fixes #13870.

(cherry picked from commit 5edcc68)
crisbeto added a commit that referenced this issue Mar 6, 2022
Reworks several components that usually contain projected content not to block animations within that content. This prevents things like expansion panels from appearing as open.

These changes are identical to #13888 which had to be reverted in the past.

Fixes #13870.
forsti0506 pushed a commit to forsti0506/components that referenced this issue Apr 3, 2022
…r#24529)

Reworks several components that usually contain projected content not to block animations within that content. This prevents things like expansion panels from appearing as open.

These changes are identical to angular#13888 which had to be reverted in the past.

Fixes angular#13870.
@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 Apr 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
animation This issue is related to Angular animations or CSS animations area: material/dialog area: material/expansion P2 The issue is important to a large percentage of users, with a workaround
Projects
None yet