Bug
When the md-input is disabled, the input text should be grayed-out. The expected behavior is documented in Google design here:
https://material.google.com/components/text-fields.html#text-fields-labels
Input text is not grayed-out.
Please refer to this plunk: http://plnkr.co/edit/fzZY5ASZ2vQlhOci8z9P
Note that the input text is the same intensity, whether or not it's disabled.
The underline, however, does correctly change to a dotted line when disabled.
User can't tell whether the input is disabled or not.
Angular 2.1.0
Material 2.0.0-alpha.10
Linux
Chrome
No.
Will likely be obsolete by <md-input> refactor.
very similar issue using reactive forms.
using this form code the md-input is not disabled. Adding the disabled keyword, angular forms generates a warning.
form = new FormGroup({
first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
last: new FormControl('Drew', Validators.required)
});
The same is happening with md-checkbox. When I disable a checkbox like this:
<md-checkbox formControlName="myControl" disabled=true></md-checkbox>
I receive this warning:
It looks like you're using the disabled attribute with a reactive form directive. If you set disabled to true when you set up this control in your component class, the disabled attribute will actually be set in the DOM for you. We recommend using this approach to avoid 'changed after checked' errors.
Example:
form = new FormGroup({
first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
last: new FormControl('Drew', Validators.required)
});
However, initializing a FormControl with { value: 'anyValue', disabled: true} doesn't seem to do anything. The input ignores the disabled property and remains enabled.
fixed by #2513
I am using 2.0.0-beta.8 and I still have this problem
@pantonis It appears to be working correctly, did you install a theme? https://material.angular.io/guide/theming
No nothing. I have to call enable(), disable() to make it work
I think the disabled styles live in the theme css, so that's probably why it doesn't look right.
?? :)
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._
Most helpful comment
very similar issue using reactive forms.
using this form code the md-input is not disabled. Adding the disabled keyword, angular forms generates a warning.
form = new FormGroup({
first: new FormControl({value: 'Nancy', disabled: true}, Validators.required),
last: new FormControl('Drew', Validators.required)
});