Skip to content

fix(overlay): don't reset global overlay alignment when width is 100% and there's a maxWidth #17842

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

Merged
merged 1 commit into from
Jan 22, 2020

Conversation

crisbeto
Copy link
Member

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 #17841.

@crisbeto crisbeto added P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release labels Nov 29, 2019
@crisbeto crisbeto requested a review from jelbourn as a code owner November 29, 2019 17:29
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 29, 2019
… 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.
@crisbeto crisbeto force-pushed the 17841/global-overlay-max-width branch from 9ad8ab6 to 68a6d1d Compare December 30, 2019 06:13
@crisbeto
Copy link
Member Author

I must've missed the notification about this one. @jelbourn the feedback is addressed now.

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker labels Jan 16, 2020
@jelbourn jelbourn merged commit 9f2c937 into angular:master Jan 22, 2020
jelbourn pushed a commit that referenced this pull request Jan 22, 2020
… and there's a maxWidth (#17842)

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 #17841.

(cherry picked from commit 9f2c937)
yifange pushed a commit to yifange/components that referenced this pull request Jan 30, 2020
… and there's a maxWidth (angular#17842)

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.
@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 Feb 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement P2 The issue is important to a large percentage of users, with a workaround target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MatDialog ist not centered if width is set to 100% but maxWidth is lower
3 participants