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): not floating the label when updating the value programmatically with reactive forms #2443

Closed
wants to merge 1 commit into from

Conversation

crisbeto
Copy link
Member

@crisbeto crisbeto commented Dec 28, 2016

Fixes the input placeholder not being floated when the value is updated programmatically via FormControl.setValue. This was because the listener that handles the value changes gets initialized before the FormControl.

Fixes #2441.

…ically with reactive forms

Fixes the input placeholder not being floating when the value is updated programmatically via `FormControl.setValue`. This was because the listener that handles the value changes gets initialized before the `FormControl`.

Fixes angular#2441.
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Dec 28, 2016
Copy link
Member

@petebacondarwin petebacondarwin left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@Optional() public _ngControl: NgControl) {
@Optional() public _ngControl: NgControl) { }

ngOnInit() {
Copy link
Member

Choose a reason for hiding this comment

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

So it is simply the case of moving the initialization into the ngOnInit hook?
Is that because the FormControl is normally changed by the "user" in their own ngOnInit method?

Copy link
Member Author

Choose a reason for hiding this comment

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

I ran across it while playing around, not sure about the reason, though.

@crisbeto
Copy link
Member Author

Closing in favour of #2455.

@crisbeto crisbeto closed this Dec 29, 2016
@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
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.

MdInput - Placeholder does not float when using formControl setValue()
3 participants