Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Scrollable" mat dialog with component

All I found about scrolling the dialog is about the overlay, but it is to describe the behavion off the dialog, but I need to scroll the content inside of it that is NOT in the mat-content, for it is an entire component.

To open the dialog I am using:

const dialogRef = this.dialog.open(CadastroPessoaComponent, dialogConfig)

The dialog config is like this:

dialogConfig.width = '90%';

like image 904
Yandiro Avatar asked Apr 14 '26 10:04

Yandiro


1 Answers

Try and set the height of your dialogConfig to your desired dialog height.

It worked for me:

const dialogRef = this.dialog.open(CadastroPessoaComponent, {
   height: '300px'
}

It will add an overflow if the height of your component content will be higher than 300px.

For the full list of dialog configuration available, check the MatDialog API.

like image 73
TheUnreal Avatar answered Apr 17 '26 02:04

TheUnreal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!