-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(overlay): wait until after change detection to position overlays #6527
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
fix(overlay): wait until after change detection to position overlays #6527
Conversation
92e1fb3
to
ef10c6c
Compare
0b77b83
to
9555c67
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one question
@@ -147,6 +147,11 @@ export class ConnectedPositionStrategy implements PositionStrategy { | |||
* allows one to re-align the panel without changing the orientation of the panel. | |||
*/ | |||
recalculateLastPosition(): void { | |||
// If the overlay had never been positioned before, do nothing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: had -> has
// before attempting to position it, as the position may depend on the size of the rendered | ||
// content. | ||
first.call(this._ngZone.onStable.asObservable()).subscribe(() => { | ||
this.updatePosition(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment implies waiting for the zone to be stable before positioning, but it looks like we are also updating the position before the zone is stable on line 58. Is it intentional to update the position twice? If so, maybe update the comment to clarify.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first call shouldn't be necessary. @jelbourn I ended up removing it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, not sure why that was still there
80b1508
to
0be6a63
Compare
0be6a63
to
6f85728
Compare
LGTM |
69cda2a
to
96683fc
Compare
Should be ready to go now. |
@kara can you describe the presubmit failure here? |
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored by someone other than the pull request submitter. We need to confirm that they're okay with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
Needs CLA |
Also, not getting any presubmit errors. @kara do you know what they were? |
@andrewseguin the CLA is fine, it's just me and Kristiyan |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
No description provided.