You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But the height is the default one. It seems that the cdk-overlay-0 is correctly styled with style="max-width: 99vw; max-height: 99vh;" but the inner div.mat-dialog-content has max-height: 65vh; which dictates the height.
All the relevant code is in app.component.ts.
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
All / latest
Is there anything else we should know?
Keep up the good work!
Reacted by Daniel Wulff, Wojciech, Michał Stawicki, Colby Rome, Pastafarian, Ankur Akvaliya, Tariyel Hamidov, Kader Mohideen Fasid, Andrew-Marks-Trisept, jagipas and 3 more
As mentioned above, the default max-height: 65vh on dialog-content is an issue (this is the element that flex grows), so first set that to max-height: none, or maybe more correct is to use calc and subtract your action bar and title bar heights:
mat-dialog-content{
// full viewport height minus action bar height
max-height:calc(100vh-74px);}
Then set height and/or max-height on your dialog using MatDialog.open. Alternatively, if you want to set height from css, you can do this:
::ng-deep.mat-mdc-dialog-panel{max-height:85vh;}@media(max-width:600px){::ng-deep.mat-mdc-dialog-panel{
// full height on mobile
max-height:100vh;}}
Activity
RobertPaulson90 commentedon Nov 21, 2017
Same issue :(
diogodomanski commentedon Dec 13, 2017
Did you try to set height and/or width too?
wojtek1150 commentedon Dec 18, 2017
Same issue
RobertPaulson90 commentedon Dec 19, 2017
My case was a user issue, what I wanted was
minHeightfix(dialog): improved handling of scrollable content
fix(dialog): improved handling of scrollable content
fix(dialog): improved handling of scrollable content
fix(dialog): improved handling of scrollable content
fix(dialog): improved handling of scrollable content
fix(dialog): improved handling of scrollable content
mstawick commentedon Feb 6, 2018
FYI, as a workaround I've applied maxHeight via
panelClassclass, and then it works as expected (as far as I can tell).fix(dialog): improved handling of scrollable content
13 remaining items
drorm commentedon Feb 1, 2019
Seems like doing something like the following works.
.mat-dialog-content { max-height: 95%; }fuzolan commentedon Feb 25, 2019
had no effect in my case. A simple fullscreen option would be nice. If you want to use mat-dialog-actions then you get another problems...
fix(dialog): improved handling of scrollable content
fix(dialog): improved handling of scrollable content
jhuiet commentedon May 9, 2019
I know this isn't the 'best' practice, but I found a simple fix for me: an inline style addition!
<mat-dialog-content style="max-height: 85vh">This was where I landed after needing scrolling on smaller screens (note the mat-dialog-content tag) and not wanting scrolling on larger screens...
akvaliya commentedon Oct 31, 2019
Any progress on this issue? It's been long time. I am facing the same issue. maxHeight has no effect on dialog.
joschne commentedon Dec 11, 2019
I think I found a relatively simple solution.
See stackblitz example and my comments in dialog-content-example.ts.
tsupryk commentedon Jun 13, 2023
Having same issue in latest Material v15 !!!
LordMidi commentedon Dec 3, 2024
Having same issue in Material v18
fredericojesus commentedon Apr 29, 2025
This is still an issue, height, max-height and min-height do not work !!!
@andrewseguin @mmalerba @crisbeto can you guys please take a look this ?
arlowhite commentedon Aug 27, 2025
I'm on Angular 20.2.1, Material 20.2.0
As mentioned above, the default
max-height: 65vhon dialog-content is an issue (this is the element that flex grows), so first set that tomax-height: none, or maybe more correct is to usecalcand subtract your action bar and title bar heights:Then set height and/or max-height on your dialog using
MatDialog.open. Alternatively, if you want to set height from css, you can do this:Though use of
::ng-deepis discouraged https://angular.dev/guide/components/styling#ng-deepAlso, if you have a
<form>around your contents and actions bar, set that todisplay: contents;arlowhite commentedon Aug 27, 2025
IMO the change should be that if height is specified with
dialog.open, then the dialog-contentmax-height: 65vhshould be removed.Something like:
where
fixed-heightclass is added to.mat-mdc-dialog-panelwhen you specifyheight(ormax-height?)