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(input): continue checking for input child after initialization #4569

Merged
merged 1 commit into from
May 17, 2017

Conversation

crisbeto
Copy link
Member

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 #4551.

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label May 15, 2017
ids.push(startHint.id);
} else if (this._hintLabel) {
ids.push(this._hintLabelId);
if (this._mdInputChild) {
Copy link
Contributor

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

Copy link
Member Author

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.

throw new MdInputContainerMissingMdInputError();
}

this._validateInputChild();
Copy link
Contributor

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

@crisbeto crisbeto force-pushed the 4551/input-presence-revalidate branch from 92f5c1e to b0f4196 Compare May 16, 2017 17:31
@crisbeto
Copy link
Member Author

Rebased and addressed the feedback @mmalerba.

@mmalerba mmalerba added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels May 16, 2017
@mmalerba
Copy link
Contributor

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.
@crisbeto crisbeto force-pushed the 4551/input-presence-revalidate branch from b0f4196 to 021b62d Compare May 16, 2017 17:54
@jelbourn jelbourn merged commit 73d6814 into angular:master May 17, 2017
@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 6, 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

at MdInputContainer._isErrorState
4 participants