Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Angular 5 / Material, how to remove vertical scroll in Mat Dialog?

I am trying to remove the vertical scrolling in a Material Dialog.

I was trying with CSS

.mat-dialog-container /deep/ {
   overflow-y: hidden;
}

and also with the code in the parent component

this.dialog._overlayContainer._containerElement.style.overflowY = "hidden";

But, there was no way to do that.

Does it know anyone how I can achive that?

Thanks

like image 749
ackuser Avatar asked Apr 23 '18 14:04

ackuser


1 Answers

Go to styles.scss file and then add the following:

.custom-dialog-container .mat-dialog-container {
  overflow-y: hidden;
}

and add

panelClass: 'custom-dialog-container'

as a part of the MatDialogRef object that you are sending to the dialogComponent

like image 162
Ritiwik Brahma Avatar answered Sep 20 '22 16:09

Ritiwik Brahma