Uh oh!
There was an error while loading. Please reload this page.
fix(dialog): improved handling of scrollable content - #9236
Conversation
8ee04db to
214f719Compare| this._savePreviouslyFocusedElement(); | ||
| return this._portalOutlet.attachComponentPortal(portal); | ||
| const componentRef = this._portalOutlet.attachComponentPortal(portal); |
There was a problem hiding this comment.
Add a comment here that explains why this extra class is added?
| @@ -1 +1,3 @@ | |||
| <ng-template cdkPortalOutlet></ng-template> | |||
| <div class="mat-dialog-component-host"> | |||
There was a problem hiding this comment.
Is this class meant to be both in the template and added manually?
There was a problem hiding this comment.
Yeah, we need to add it through both to cover both template and dialog portals. The class is used to propagate the max-height down correctly since we've got a lot of nested divs.
| /** Max-height of the dialog. If a number is provided, pixel units are assumed. */ | ||
| maxHeight?: number | string; | ||
| maxHeight?: number | string = '80vh'; |
There was a problem hiding this comment.
Was this 65vh before? If so, we probably would need to keep the same max-height until a major version change
There was a problem hiding this comment.
It wasn't, it was the scrollable content that was 65vh, this applies the height to the overlay pane itself.
| justify-content: center; | ||
| width: 100%; | ||
| flex-shrink: 0; | ||
| order: 1; |
There was a problem hiding this comment.
Wouldn't specifying the order take away the ability to put custom content in between the regions?
There was a problem hiding this comment.
I suppose that it would, but the assumption is that if they're using the content element, they're putting all their content into it. I'm fine with removing it though, we haven't had it until now.
There was a problem hiding this comment.
If the only reason would be to let people put the dialog directives in any order, I'd rather omit it to give people control in case they need to do something special
214f719 to
fb4dbf0Comparecrisbeto
commented
Jan 12, 2018
Addressed the feedback @jelbourn. |
fb4dbf0 to
67ab3e9Compare67ab3e9 to
2a31c21Comparedinamix1
commented
Mar 21, 2018
Looking forward to this merge! |
2a31c21 to
2c65285Compare2c65285 to
3c45beeComparepharv
commented
Apr 23, 2018
Great work on this PR! I am really looking forward to this enhancement as well. It looks like the only reason it hasn't been merged in yet is because the Travis CI build failed due to server issues. Can someone please re-run the build? Thanks! |
Devvox93
commented
Jun 22, 2018
What are the presubmit failures that are keeping this from being merged? |
Hi @crisbeto! This PR has merge conflicts due to recent upstream merges. |
3c45bee to
0297e10Compare0297e10 to
d0ebb1eComparetammysock
commented
Jul 17, 2018
This fix will be very helpful. Any updates on the PR? |
swftvsn
commented
Aug 23, 2018
* Improves the handling of scrollable content inside the `mat-dialog-content` by using flexbox, rather than a hardcoded `max-height`, to define the content height. This resolves various issues where the dialog would go out of the screen at certain screen sizes or have multiple scrollbars. * Uses flexbox to ensure that the dialog content elements are always at the appropriate size. Fixesangular#2481. Fixesangular#3239. Fixesangular#6584. Fixesangular#8493.
cc3ba6f to
dccfb41CompareMaximoB
commented
May 6, 2019
This PR would fix major problems I'm having using MatDialog, any updates? |
akvaliya
commented
Oct 31, 2019
What is the status of this PR? When will it be completed. |
charsleysa
commented
Jan 9, 2020
@jelbourn is this still blocked? |
jelbourn
commented
Jan 9, 2020
Yes- we haven't work on this since the last update. At this point, we'll probably see if we can address this as part of our work on integrating MDC-web into the components. |
AlexElin
commented
Mar 3, 2021
@jelbourn have you had a chance to find out whether integrating MDC-web into the components will solve the problems that this PR intended to solve? |
jelbourn
commented
Mar 3, 2021
@crisbeto is this something you've looked at for the mdc dialog? |
crisbeto
commented
Mar 3, 2021
I haven't looked into the MDC dialog since somebody else implemented it. |
josephperrott
commented
Nov 19, 2021
@crisbeto Looks like this PR has fallen out of date, can you please rebase the PR. |
Mikastark
commented
Aug 1, 2023
Hope this PR is not abandoned and will be merged someday |
mat-dialog-contentby using flexbox, rather than a hardcodedmax-height, to define the content height. This resolves various issues where the dialog would go out of the screen at certain screen sizes or have multiple scrollbars.Fixes#2481.
Fixes#3239.
Fixes#6584.
Fixes#8493.