Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
MatDialog ist not centered if width is set to 100% but maxWidth is lower #17841
Steps to reproduce:
What behavior were you expecting to see?
What behavior did you actually see?
You're right that we shouldn't be doing this when there's a
… and there's a maxWidth A long time ago we introduced some logic that clears the `justifyContent` from a global overlay if it's `width` is set to 100%, in order to ensure that the element is flush against the viewport edge. Some time later we added a `maxWidth` option, but we never accounted for it which means that if an element is set to be `width: 100%; maxWidth: '500px'`, we'll reset the alignment incorrectly. These changes tweak the logic so it only resets if there is no `maxWidth` or if it's set to 100%. Fixes angular#17841.