components icon indicating copy to clipboard operation
components copied to clipboard

[Feature request] MatDialog config option to disable scroll-blocking

Open Tobbyte opened this issue 9 years ago • 7 comments

Bug, feature request, or proposal:

Feature request

What is the expected behavior?

A config option to disable the scroll-blocking behavior of a dialog (so that the underlaying page could be used as without the dialog)

What is the current behavior?

There's an option to disable to backdrop hasBackdrop but the underlaying site still isn't scrollable (but clickable though)

What is the use-case or motivation for changing an existing behavior?

With this feature it would be possible to "pin" a dialog like gmails compose-email window.

Tobbyte avatar Nov 29 '17 10:11 Tobbyte

Help me please to find some explanation how to set scroll strategy for MatDialog in configs.

iuada0j0 avatar Mar 07 '18 14:03 iuada0j0

You can pass it in as an option when you open the dialog @Adrian1907:

constructor(public dialog: MatDialog, overlay: Overlay) {
    dialog.open(JazzDialog, {
      scrollStrategy: overlay.scrollStrategies.noop()
    });
  }

crisbeto avatar Mar 07 '18 14:03 crisbeto

@crisbeto Does it require any imports? My editor tells me:

Cannot find name 'overlay'

iuada0j0 avatar Mar 07 '18 14:03 iuada0j0

You have to import {Overlay} from '@angular/cdk/overlay';.

crisbeto avatar Mar 08 '18 10:03 crisbeto

@crisbeto Thanks, now it works!

iuada0j0 avatar Mar 12 '18 08:03 iuada0j0

Please note: For iOS Safari, when opening a dialog the browser chrome will reappear if previously hidden (due to this css class changing the scroll position + making it position: fixed). This same code will prevent the chrome from appearing - which can be a bad and 'jumpy' user experience.

simeyla avatar Jun 11 '18 23:06 simeyla

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.