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

MdDialog scroll in another context #5302

Closed
crtl opened this issue Jun 22, 2017 · 12 comments
Closed

MdDialog scroll in another context #5302

crtl opened this issue Jun 22, 2017 · 12 comments

Comments

@crtl
Copy link

crtl commented Jun 22, 2017

feature request, proposal:

I dont want to scroll the md-dialog-content but the whole dialog so the scrollbar is outside of the dialog.

What is the expected behavior?

Scroll the entire dialog and not only the md-dialog-content.
I created a small example with the expected behaviour. You can find it here on codepen.

What is the current behavior?

md-dialog-content is scrolled inside the dialog.

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

The developer should have to decide how the dialog is scrolled to match it with a specific use case.

Is there anything else we should know?

I've read in the changelog that there is a new ScrollStrategy API to affect the scrolling of overlays but I cannot find any documentation and the MdDialogConfig does not support the scrollStrategy option.

So it is possible to change the scrolling behaviour for the dialog at the current version?
If so then how?

@julianobrasil
Copy link
Contributor

Have you try it without md-dialog-content like said this issue: #5002?

@crtl
Copy link
Author

crtl commented Jul 4, 2017

Sure, but md-dialog-container has its scrollbar inside the dialog and not outside.
Please look at the example I hope it clarifys what I mean.

@m98
Copy link
Contributor

m98 commented Jul 4, 2017

@crtl This repository is for Material 2, for questions related to Angular 1 Material, please fill issue here

@crtl
Copy link
Author

crtl commented Jul 4, 2017

@m98 this is not AngularJS related. I just used an AngularJS example to describe the targeted behaviour.

@julianobrasil
Copy link
Contributor

julianobrasil commented Jul 4, 2017

@ctrl, if you put the content outside <md-dialog-content>, the dialog do not show any scrollbar inside. The bad news is that it's parent do not show it either 😹.

image

@m98
Copy link
Contributor

m98 commented Jul 4, 2017

@julianobrasil Cool! It's almost done 😄

it seems to be a bug, or maybe there is an option for this?

@julianobrasil
Copy link
Contributor

julianobrasil commented Jul 4, 2017

I think that dialog was not planned to work with large contents outside md-dialog-content tag. You can try playing around with panelClass (the applied to the div that contains dialog) and backdropClass to see what do you get. Take a look in this @willshowell comment: #3239 (comment)

@m98
Copy link
Contributor

m98 commented Jul 4, 2017

@jelbourn If scrollable dialogs are not already planned I can take to do it.
Here is the expected behavior:

Maybe the user can activate it by setting a certain attribute, such as scrollable="true" then we can check if the content height is longer than the current dialog size, show light scroll for the content, and on the mobile devices user can use gesture to scroll.

@julianobrasil
Copy link
Contributor

julianobrasil commented Jul 4, 2017

@m98, scrollable dialog are planned. You just have to put the content inside <md-dialog-content>:

image

What is not planned is something that looks like the example linked on the issue description (the vertical scrollbar in the backdrop panel instead of in the content part):

image

But I think it can be achieved with the using of backdropClass option.

@m98
Copy link
Contributor

m98 commented Jul 4, 2017

@julianobrasil scrolling whole dialog is not what material design says:

For scrollable lists of options, the dialog title remains pinned to the top. This ensures that a selected item remains visible with the title, regardless of the item’s position in the list. Otherwise, the title scrolls off with the content. Actions always remain in place when content scrolls. Dialogs are separate from the underlying parent material and do not scroll with it.
(source)

@crisbeto
Copy link
Member

crisbeto commented Jul 4, 2017

There's no plan for allowing the entire dialog to be scrollable out-of-the-box, because it doesn't match the Material spec. If you want scrollable content, you can style the dialog yourself or use md-dialog-content. I've been planning on spending some time refactoring the dialog to help with cases like #3239.

@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 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants