I was looking for a similar solution as OP. The trick in the provided example is to set overflow:auto
on the .cdk-global-overlay-wrapper
.
Add this css to your styles (not inside the dialog's css):
Altough there's a slight issue, without auto pointer-events scrolling does not work on current chrome version and with auto pointer-events, closing via backdrop click does not work.
(will update if i find a solution)
.cdk-global-overlay-wrapper {
overflow: auto;
pointer-events: auto; // needed for chrome but prevents backdrop click close
}
If you want to prevent scrolling on the back scenery i.e. parent component you could set overflow: hidden
on the parent as long as the dialog is open.
.. just remove the scroll strategy from the example.