Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Tobbyte opened this issue Nov 29, 2017 · 7 comments · Fixed by #8726
Closed

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

Tobbyte opened this issue Nov 29, 2017 · 7 comments · Fixed by #8726
Assignees
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@Tobbyte
Copy link

Tobbyte commented Nov 29, 2017

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.

@crisbeto crisbeto self-assigned this Nov 29, 2017
@crisbeto crisbeto added feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent has pr labels Nov 29, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Nov 29, 2017
Currently we have the `MAT_DIALOG_SCROLL_STRATEGY` token which allows consumers to specify the scroll strategy for all dialogs, however there's no way do so for a single dialog. These changes add an extra property to the dialog config that allow for the scroll strategy to be set.

Fixes angular#8706.
crisbeto added a commit to crisbeto/material2 that referenced this issue Dec 2, 2017
Currently we have the `MAT_DIALOG_SCROLL_STRATEGY` token which allows consumers to specify the scroll strategy for all dialogs, however there's no way do so for a single dialog. These changes add an extra property to the dialog config that allow for the scroll strategy to be set.

Fixes angular#8706.
jelbourn pushed a commit that referenced this issue Jan 4, 2018
…en (#8726)

Currently we have the `MAT_DIALOG_SCROLL_STRATEGY` token which allows consumers to specify the scroll strategy for all dialogs, however there's no way do so for a single dialog. These changes add an extra property to the dialog config that allow for the scroll strategy to be set.

Fixes #8706.
tinayuangao pushed a commit that referenced this issue Jan 10, 2018
…en (#8726)

Currently we have the `MAT_DIALOG_SCROLL_STRATEGY` token which allows consumers to specify the scroll strategy for all dialogs, however there's no way do so for a single dialog. These changes add an extra property to the dialog config that allow for the scroll strategy to be set.

Fixes #8706.
@Adrian1907
Copy link

Adrian1907 commented Mar 7, 2018

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

@crisbeto
Copy link
Member

crisbeto commented Mar 7, 2018

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()
    });
  }

@Adrian1907
Copy link

Adrian1907 commented Mar 7, 2018

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

Cannot find name 'overlay'

@crisbeto
Copy link
Member

crisbeto commented Mar 8, 2018

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

@Adrian1907
Copy link

Adrian1907 commented Mar 12, 2018

@crisbeto Thanks, now it works!

@simeyla
Copy link

simeyla commented Jun 11, 2018

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.

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature This issue represents a new feature or feature request rather than a bug or bug fix P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants