Skip to content
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): make outline appearance work in situations where the… #10943

Merged
merged 2 commits into from Apr 21, 2018

Conversation

mmalerba
Copy link
Contributor

… form field is not initially in the DOM.

fixes #10498

@mmalerba mmalerba added P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful pr: needs review G This is is related to a Google internal issue labels Apr 20, 2018
@mmalerba mmalerba requested a review from crisbeto April 20, 2018 21:28
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Apr 20, 2018
@@ -419,6 +419,9 @@ export class MatFormField extends _MatFormFieldMixinBase
// getBoundingClientRect isn't available on the server.
return;
}
if (!document.contains(this._elementRef.nativeElement)) {
Copy link
Member

Choose a reason for hiding this comment

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

This one'll probably throw in Universal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The line above is returning if we're not in the browser

@@ -195,6 +195,8 @@ export class MatFormField extends _MatFormFieldMixinBase

_outlineGapStart = 0;

_initialGapCalculated = false;
Copy link
Member

Choose a reason for hiding this comment

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

Rather than adding another property, couldn't we get away with checking that the gap is greater than 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently that would cause a check loop for other types of form-field, since they set the gap to 0. I could set it to 1 or some other number in that case since its not really used, but this just seemed clearer

Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

LGTM

@crisbeto crisbeto added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Apr 20, 2018
@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 Sep 8, 2019
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 G This is is related to a Google internal issue P1 Impacts a large percentage of users; if a workaround exists it is partial or overly painful
Projects
None yet
Development

Successfully merging this pull request may close these issues.

form-field: outline gap calculated incorrectly with setTimeout
3 participants