-
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(input): continue checking for input child after initialization #4569
fix(input): continue checking for input child after initialization #4569
Conversation
ids.push(startHint.id); | ||
} else if (this._hintLabel) { | ||
ids.push(this._hintLabelId); | ||
if (this._mdInputChild) { |
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.
Do we need this if? It will error on _validateInputChild
before getting to this
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.
We do. This one seems to fire before the validation has had a chance to run.
src/lib/input/input-container.ts
Outdated
throw new MdInputContainerMissingMdInputError(); | ||
} | ||
|
||
this._validateInputChild(); |
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.
not really related to this PR, but I see _prefixChildren
and suffixChildren
are unused, want to just get rid of them?
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.
92f5c1e
to
b0f4196
Compare
Rebased and addressed the feedback @mmalerba. |
lgtm |
Currently we only check if an `md-input-container` has a child upon initialization, however the child might be removed via `ngIf` at a later point. If that happens, we eventually run into some check that assumed that we have an input child, however it would be better if we threw the appropriate error. These changes add extra validation that ensure that the input continues to be in place after init. Fixes angular#4551.
b0f4196
to
021b62d
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. |
Currently we only check if an
md-input-container
has a child upon initialization, however the child might be removed viangIf
at a later point. If that happens, we eventually run into some check that assumed that we have an input child, however it would be better if we threw the appropriate error. These changes add extra validation that ensure that the input continues to be in place after init.Fixes #4551.