Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

dynamically change width/height of a mat-dialog in Angular 12

it is possible to change dynamically the height/width of a mat-dialog according the content inside?

for example, if I have a mat-select with three options and each one shows a different number of fields below the select field, it is possible to do the dialog change size to fill the content?

I'm learning Angular and don't know if its possible. I do not have any ideias how could do that

like image 774
Marcos Matheus Avatar asked Jan 19 '26 17:01

Marcos Matheus


1 Answers

https://stackoverflow.com/a/65718180/6490545

The dialog does automatically adapt to the content as long as its html is wrappend inside mat-dialog-content

Angular Material Examples

Material Dialog Config - you can set minHeight/minWidth for dialogs

like image 192
Piotr Sternik Avatar answered Jan 22 '26 06:01

Piotr Sternik