-
Notifications
You must be signed in to change notification settings - Fork 6.8k
md-input displays value on top of placeholder if disabled and value is bound from a component class property #2816
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
Comments
Same problem here. Which versions of Angular, Material, OS, browsers are affected?
|
Workaround: The issue does not occur when the [ngModel] binding is used instead of [value] |
This bug occurs even if the field is not disabled. I am having the same issue using reactive forms when I set the value outside of the onInit method (for example after fetching data from API). The end result is that the md-empty class still remains on the input component's label, even though a value is set. I am using this method to 'patch' a single control's value:
where this.myForm is a FormGroup and myData is an object that has properties named the same as the controls in myForm. See this plunk: https://plnkr.co/edit/nDrY5UhWSGe3jMtgGuHb?p=preview |
This has been fixed in master, just needs a release |
Excellent! I just worked that out with a new plunk which works with the master version: Do you know when the master will be released? |
Excellent, that's great news! Thank you! |
When then next released? @mmalerba |
We're working on it. There's a couple important changes we want to get in first, can't give an exact date yet, soon though |
I used this temporarily: |
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. |
Bug, feature request, or proposal:
md-input displays value on top of placeholder if disabled and value is bound from a component class property
What is the expected behavior?
The placeholder shall be smaller and displayed above the value
What is the current behavior?
The placeholder is displayed with a larger font size behind the value
What are the steps to reproduce?
See the company input field in this plunk:
https://plnkr.co/edit/J9e4gAkC5jIEdTbyUbqd?p=preview
What is the use-case or motivation for changing an existing behavior?
Want to use placeholder values on non-editable fields in a form to have the same name->value pattern for all items in the form.
Which versions of Angular, Material, OS, browsers are affected?
@angular/material 2.0.0-beta.1
@angular 2.4.2
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: