I tried to make a scroll for a dialog in reposition strategy, but it doesn't work for me.
const scrollStrategy = this.overlay.scrollStrategies.reposition();
const dialogRef = this.dialog.open( DialogOverviewExampleDialog, { scrollStrategy } );
I expect that during scrolling the whole dialog(element .cdk-overlay-pane
) will move
If you want to scroll the content of the dialog then you have to use the
<mat-dialog-content>
tag, or use the directive mat-dialog-content in your div element. In your example try the following instead:And now your dialog content should have a scroll on the side. Read more about the Scrollable content container of a dialog on:
https://material.angular.io/components/dialog/api#MatDialogContent
compare all the files difference. there is extra css in style.css
Since https://github.com/angular/material2/pull/11235,
.mat-dialog-container
gotmax-height: inherit
which should solve your problem.Setting
maxHeight: window.innerHeight + 'px'
on the dialog configuration prevents the dialog from growing bigger than the screen.I tried this way,
Hi try to put this on your style.css or style.scss