Expansion panel FOUC when contained in dialog
See original GitHub issueI’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:
- Created 5 years ago
- Reactions:51
- Comments:37 (4 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Another workaround is to disable all animations until
ngAfterViewInit
using the[@.disabled]
property on a parent element.https://stackblitz.com/edit/angular-issue13870-workaround
Still persist on Angular Material 10.0.1