-
Notifications
You must be signed in to change notification settings - Fork 6.8k
MatDialog mat-dialog-actions is not at the bottom of the dialog #4609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@crisbeto looks like this happens when explicitly setting a height on the dialog |
Oh this is for ng2, same is happening for me using material 1.1.3 |
I can confirm it indeed seems to occur the moment you set a specific height on the dialog. https://plnkr.co/edit/1Vn3D3E2ozdO80rLlleS?p=preview |
Also duplicate of #4053 |
Is there any news about this issue? thanks |
Any news? |
The other ticket points to this ticket :D but I can't see any solution(?) |
I have found this to work as a temporary fix when explicitly setting height on a MatDialog. my-dialog.component.html:
my-dialog.component.css:
|
Is this a feature instead of a bug? Are we intended to replicate this ourselves? This issue has been open a longgg time |
not specifying the height worked for me. |
Is there any update about this issue? @jelbourn |
This comment has been minimized.
This comment has been minimized.
Please reopen the bug ticket, it was not implemented and to say moving to vue will not resolve the ticket. @ashishdoneriya if you are not interested anymore in it, fine, but leave it open for everyone else. Thx. |
@Chris2011 ok chris |
My experience: Bug, feature request, or proposal: What is the expected behavior? What is the current behavior? What are the steps to reproduce? Which versions of Angular, Material, OS, TypeScript, browsers are affected? |
@crisbeto I saw that you are working on dialog fixes. Could you please tell us if this issue will be fixed? It was opened more than a year ago and nothing has been done. |
There really really needs to be a better way to specify different dialog scaling strategies beyond the existing positioning strategies (such as full screen with an optional margin). Then problems like this would go away. I expect the primary reason to set height on a dialog in the first pace is to make it stretch, or stop it overflowing the page. The number one thing a dialog control should do it take the burden of sizing away from me! |
Any news or workaround for this? @atrombet's solution didn't work for me. =( |
Yes, please fix this. Workarounds are fine, but it is a lot more time saving if it comes placed correctly out of the box. :( |
As @dpolicastro mentioned none of these solutions work if only minHeight and not height) is set. |
Hey guys! Time to fix it! Every workaround makes my code just ugly... |
I refined the above work of @DanielHabenicht to handle minHeight. helper my-dialog.component.css:
paired with helper dialog.service.ts:
To make the height & minHeight property values pass down to the dialog body's container, each parent (i.e. my-dialog) between it and ancestor mat-dialog must pass them through e.g. ... dialog instance component my-confirm-dialog.component.scss
and set viewEncapsulation none with my-confirm-dialog.component.ts
|
Any news? |
@austinkulp It isn't a framework. It is only a lib and has nothing to compare with Vue. |
@DanielHabenicht this is great, but it seems to remove my backdrop... 🤔 Upon removing the override the backdrop returns. Any idea how these are correlated? EDIT:
|
For me, .mat-dialog-content {
height: 100%;
} did the trick, when I have a set dialog height const dialogConfig = new MatDialogConfig();
dialogConfig.height = '80%'; |
Hello, |
The proposed fix didn't worked for me. Following code solved my case (when specifying height: '85vh' in this.dialog.open):
|
The bug is still present in Angular Material 13 😕 |
Leaving a comment to note that this is still a popular issue that devs want fixed please. Work-arounds are ugly. |
Also jumping on here to be annoying and say this bug is still present |
Using Angular 13. If I don't set the height of the dialog component then the dialog's action buttons are nicely positioned at the bottom of the dialog. However, when internal dialog's content changes size (say, tabs and each tab is different height) then the whole dialog window is resizing depending on the content. This is quite frustrating UX, so I'd have fixed the height of the dialog. With this, I get another issue, this time UI related, the action buttons sometimes end up in the middle of the dialog. The whole situation cannot be helped with the fact that styling dialogs without turning off viewEncapsulation isn't possible. |
Joining the queue. The proposed solutions in the comments are not satisfying at all. |
It is now 5 years, and this is still an issue. |
If you don't want to wait another 5 years to fix your issue here is what works for me with a fullscreen dialog: open dialog config:
modal style
|
There is simpler css workaround for that, without adding additional html elements. In your component html:
In your scss file for that component:
|
Who knew getting the modal action buttons to line up on the bottom of the page would be such a challenge? I guess I'll just use a bootstrap modal or something. |
It works for me
|
It still happening at Angular 18? |
Still hitting that bug with Angular 18... |
It's still happened at Angular 19.. |
I found this to work for me. Having no mat-dialog-content and setting a height to that will make the actions stick to the bottom.
Use this if you dont need mat-dialog-content |
Bug:
Angular Material is not placing md-dialog-actions at the bottom
What is the expected behavior?
Should be at the bottom
What is the current behavior?
Currently, it is placed just after md-dialog-content
What are the steps to reproduce?
Add md-dialog-actions
Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://plnkr.co/edit/S2D0g6NOPpVRYoc6KA7L?p=preview
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
angular 4, material ^2.0.0-beta.5, os ubuntu 16.04, typescript ~2.0.3, browser : chrome
The text was updated successfully, but these errors were encountered: