-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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(form-field): properly handle measuring outline gap when label is not initially in the dom #12782
Conversation
de05bb3
to
94f0642
Compare
94f0642
to
3a8b9ff
Compare
src/lib/form-field/form-field.ts
Outdated
@@ -448,6 +452,13 @@ export class MatFormField extends _MatFormFieldMixinBase | |||
return; | |||
} | |||
|
|||
// If the element is not present in the DOM, the outline gap will need to be calculated | |||
// the next time it is checked and in the DOM. | |||
if (document && !document.documentElement.contains(this._elementRef.nativeElement)) { |
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.
use platform.isBrowser
https://github.com/angular/material2/blob/master/src/cdk/platform/platform.ts#L29 (I see there's already a check for this down below, maybe you can simplify the logic a bit)
31a6a42
to
d46964c
Compare
d46964c
to
457847f
Compare
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. |
Addresses #12780