-
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
[input @alpha.8-1] Setting bound FormControl to disabled causes valueAccessor.setDisabledState error #1171
Comments
@kara Help please |
I'm seeing this with md-checkbox too, so I would assume it is a wider angular2-material issue. |
The issue still occurs, and ,unfortunately, leaves the It reproduces on To add on to the above, the same applies, when using the Thanks in advance. |
Here is a work around that works for me: this.form.controls['val1'].statusChanges.subscribe((newStatus) => { if (newStatus === VALID) { |
+1 Interface |
There is |
It looks if I use [disabled] on the |
Is there any update on getting proper programmatic disabling to work for use with reactive forms? |
@crisbeto we should add |
… from ControlValueAccessor Implements the `setDisabledState` method from the `ControlValueAccessor` interface in all of the input-related components, in order to support disabling via reactive forms. Note that the `select` component is missing the implementation, however there's a pending PR for it already (angular#1667). Fixes angular#1171.
… from ControlValueAccessor Implements the `setDisabledState` method from the `ControlValueAccessor` interface in all of the input-related components, in order to support disabling via reactive forms. Note that the `select` component is missing the implementation, however there's a pending PR for it already (angular#1667). Fixes angular#1171.
The fix hasn't been merged yet @RoxKilly. |
… from ControlValueAccessor Implements the `setDisabledState` method from the `ControlValueAccessor` interface in all of the input-related components, in order to support disabling via reactive forms. Note that the `select` component is missing the implementation, however there's a pending PR for it already (angular#1667). Fixes angular#1171.
"angular-cli": "1.0.0-beta.16" got this issue with checkbox. Any help? |
@Dominionys The two posts immediately before yours show that the issue was not fixed in time for alpha 10. |
… from ControlValueAccessor (#1750) Implements the `setDisabledState` method from the `ControlValueAccessor` interface in all of the input-related components, in order to support disabling via reactive forms. Note that the `select` component is missing the implementation, however there's a pending PR for it already (#1667). Fixes #1171.
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:
Bug
What is the expected behavior?
Angular recommends, when using reactive forms, to set
disabled
on theFormControl
rather than the input element in the template:What is the current behavior?
Setting
disabled: true
on aFormControl
bound tomd-input
will cause the app to crash with error:This does not happen to the native text input.
What are the steps to reproduce?
Open this plunker and look at the console. If in
AppComponent
you replace:With
The error will go away
Which versions of Angular, Material, OS, browsers are affected?
Angular 2 rc 6
withMaterial alpha 8.1
The text was updated successfully, but these errors were encountered: