question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Expansion panel FOUC when contained in dialog

See original GitHub issue

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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:51
  • Comments:37 (4 by maintainers)

github_iconTop GitHub Comments

99reactions
dcrouch79commented, Jul 4, 2019

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

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

23reactions
JoshuaAlzatecommented, Jul 4, 2020

Still persist on Angular Material 10.0.1

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using mat-expansion-panel in dialog causes scroll to bottom ...
open) that contains a <mat-expansion-panel> , I find that the browser scrolls this panel into view, if it is at the bottom of...
Read more >
Expansion Panel | Angular Material
Expands the expansion panel if collapsed. Focuses the panel. Gets the description text of the panel. Description text or null if no description...
Read more >
Expansion panels - Components - Material Design
An expansion panel is a lightweight container that may either stand alone or be connected to a larger surface, such as a card....
Read more >
A CSS Approach to Trap Focus Inside of an Element
If focus is on the first tab-able element inside the dialog, moves focus to the last tab-able element inside the dialog.
Read more >
Using the WAI-ARIA aria-expanded state to mark expandable ...
In FF14 the focus is OK but it does not announce expandable ... used with elements of the following roles: alert, alertdialog, application,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found