-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(form-field): outline gap not calculated when appearance is provided through DI #12767
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): outline gap not calculated when appearance is provided through DI #12767
Conversation
Marking as P2, because it appears to be a regression after 03527c6. |
dcf010e
to
8395c16
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
Hi @crisbeto! This PR has merge conflicts due to recent upstream merges. |
8395c16
to
c9f9e73
Compare
src/lib/form-field/form-field.ts
Outdated
set appearance(value: MatFormFieldAppearance) { | ||
const oldValue = this._appearance; | ||
this._appearance = value; | ||
|
||
if (value) { |
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.
I think previously if you passed null it was the same as setting it to legacy. This seems to be changing it to ignore null, is there a reason for that?
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.
Maybe we can do this._appearance = this._defaults && this._defaults.appearance || 'legacy'
instead?
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 reason for adding the null check was to avoid having to repeat this._appearance = this._defaults && this._defaults.appearance || 'legacy'
in two places.
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 but people can still set null
via a template binding
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.
Done.
…ed through DI Fixes the outline gap not being calculated if the `appearance` is set through the default options, because it doesn't go through the setter and we're not guaranteed for the `MutationObserver` callback to fire at the right time. Fixes angular#12765.
c9f9e73
to
6775ea6
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. |
Fixes the outline gap not being calculated if the
appearance
is set through the default options, because it doesn't go through the setter and we're not guaranteed for theMutationObserver
callback to fire at the right time.Fixes #12765.