-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
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
In Angular 18 and earlier, a closed mat-expansion-panel was using similar vertical space in the browser and in print mode (using ctrl+p on Windows machine).
In Angular 19 and 20, the vertical space of the same closed mat-expansion-panel is using the vertical space as if it was opened.
Reproduction
StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-cuvqadqx?file=src%2Fmain.ts
Steps to reproduce:
- Open the preview in a new tab
- Press ctrl+p
Here a second StabkBlitz in Angular 18 : https://stackblitz.com/edit/stackblitz-starters-wrc7q5tn?file=src%2Fmain.ts
Use the same steps to reproduce. Notice how the expansion-panel is using a vertical space similar to the browser display.
I've joined a screenshot with a black arrow indicating the vertical space which is taken (and should not as the expansion-panel is closed, as we can see on the left of the screen).
Expected Behavior
The vertical space for the closed expansion panel in print mode should be similar to the vertical space when displayed in the browser.
Actual Behavior
The vertical space for the closed expansion panel in print mode is as if it was opened (but the content is not displayed)
Environment
- Angular: 19 or 20 (both concerned)
- CDK/Material: 19 or 20 (both concerned)
- Browser(s): Edge/Chrome
- Operating System (e.g. Windows, macOS, Ubuntu): Windows 10 Professional.