-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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(dialog): avoid subpixel rendering issues and refactor GlobalPositionStrategy #1962
fix(dialog): avoid subpixel rendering issues and refactor GlobalPositionStrategy #1962
Conversation
z-index: $md-z-index-overlay-container; | ||
} | ||
|
||
// Wrapper element for the panes that use the GlobalPositionStrategy. |
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.
Expand this with something like
// We use an extra wrapper element in order to use make the overlay itself a flex item.
// This makes centering the overlay easy without running into the subpixel rendering
// problems tied to using `transform`.
private _rightOffset: string = ''; | ||
private _alignItems: string = ''; | ||
private _justifyContent: string = ''; | ||
private _wrapper: HTMLElement; |
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.
Add description for _wrapper
that explains what it's for and that it's lazily created.
@@ -3,4 +3,7 @@ export interface PositionStrategy { | |||
|
|||
/** Updates the position of the overlay element. */ | |||
apply(element: Element): Promise<void>; | |||
|
|||
/** Cleans up any DOM modifications made by the position strategy, if necessary. */ | |||
dispose?(): void; |
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.
Let's make this required and give ConnectedPositionStrategy
a no-op dispose
, then we won't have to check whether it exists before calling it.
…ionStrategy Refactors the `GlobalPositionStrategy` to use flexbox for positioning. This avoids the subpixel rendering issues that come with using transforms for centering. Fixes angular#932.
348cb42
to
eab458f
Compare
Applied the feedback and rebased. |
LGTM |
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. |
Refactors the
GlobalPositionStrategy
to use flexbox for positioning. This avoids the subpixel rendering issues that come with using transforms for centering.Fixes #932.