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
{{ message }}
Repository navigation
Dialog with fixed height less than 100% has 2 scrollbars #6584
Came here for a solution and it's happening to me as well with a fixed height dialog. Same as the previous post. It only happens for me if I use the mat-dialog-content directive to wrap my content. Otherwise the main dialog scrollbar is the only one present.
Use cases:
fixed height on dialog
use mat-dialog-content directive
double scroll bars
fixed height on dialog
no mat-dialog-content
single scroll bar, but not fixed header
no fixed height on dialog
use mat-dialog-content-directive
single scroll bar, but not the height I want.
Almost another year has passed by and this error still persists. No news whatsoever on this?
Reacted by Adam Morgan, Huon Imberger, Dane Neves, Iago Coutinho Campos, Michał Stawicki, Arthur Brandstetter, Johnatan Vélez Giraldo, mvarga-panaya and tom2all
@andrewseguin@crisbeto Could you please look into this again. As @mycroft16 stated the problem is not there when you don't use the mat-dialog-content slot... But when you do that and you have focus on the action buttons on init of dialog, you do not see the dialog title. And for the content only the bottom part...
So if you use the dialog as it is supposed to be, to have "sticky" header title and footer actions, you get this:
Therefore you need to look at the dialog config if there is a value present "height" or "maxHeight" and according to those values, calculations need to be made to set the correct "height" or "maxHeight" on the mat-dialog-content as inline styling (same as for the panel)... In our example this would be "max-height: 256px". We need to do this because the mat-dialog-content class has a fixed "responsive" height, being "max-height: 65vh;".
Thanks for looking into it and please do keep us posted!
It's a big problem particularly iOS devices as the actions buttons zoom out with full screen modal but if you set maxHeight it brings scrollbar for android devices.
Activity
julianobrasil commentedon Aug 22, 2017
It seems ok over here (Chrome, Windows 10);
tytskyi commentedon Aug 22, 2017
@julianobrasil could you shrink browser vertically?
I have this problem on 2 laptops + 1 desktop monitor
julianobrasil commentedon Aug 22, 2017
It happened with the browser shrinked.
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
fix(dialog): improved handling of scrollable content
surachaitanya commentedon Feb 6, 2018
Is there any temporary solution I can apply, until this is fixed?
fix(dialog): improved handling of scrollable content
fix(dialog): improved handling of scrollable content
8 remaining items
fix(dialog): improved handling of scrollable content
fix(dialog): improved handling of scrollable content
fix(dialog): improved handling of scrollable content
mergin commentedon May 7, 2019
The issue is still happening with fixed height:
https://stackblitz.com/edit/angular-axeibr
mycroft16 commentedon Jun 7, 2019
Came here for a solution and it's happening to me as well with a fixed height dialog. Same as the previous post. It only happens for me if I use the mat-dialog-content directive to wrap my content. Otherwise the main dialog scrollbar is the only one present.
Use cases:
fixed height on dialog
use mat-dialog-content directive
double scroll bars
fixed height on dialog
no mat-dialog-content
single scroll bar, but not fixed header
no fixed height on dialog
use mat-dialog-content-directive
single scroll bar, but not the height I want.
tommueller commentedon May 5, 2020
Almost another year has passed by and this error still persists. No news whatsoever on this?
Laurensvdw commentedon Mar 12, 2021
@andrewseguin @crisbeto Could you please look into this again. As @mycroft16 stated the problem is not there when you don't use the mat-dialog-content slot... But when you do that and you have focus on the action buttons on init of dialog, you do not see the dialog title. And for the content only the bottom part...

So if you use the dialog as it is supposed to be, to have "sticky" header title and footer actions, you get this:

Test stackblitz
The expected result would be:

Therefore you need to look at the dialog config if there is a value present "height" or "maxHeight" and according to those values, calculations need to be made to set the correct "height" or "maxHeight" on the mat-dialog-content as inline styling (same as for the panel)... In our example this would be "max-height: 256px". We need to do this because the mat-dialog-content class has a fixed "responsive" height, being "max-height: 65vh;".
Thanks for looking into it and please do keep us posted!
brandart commentedon Feb 10, 2022
this is very annoying. is there any way around?
RueDeRennes commentedon Apr 15, 2022
is there now a fix?
nikhil-clearcals commentedon Apr 30, 2022
Is this bug fixed by any chance ?
uncleGera commentedon May 4, 2022
I have a workaround. I was able to solve the issue by adding this styles to
.mat-dialog-containerand dialog component:This is how it looks like:

Stackblitz example
masum7 commentedon Apr 6, 2023
It's a big problem particularly iOS devices as the actions buttons zoom out with full screen modal but if you set maxHeight it brings scrollbar for android devices.