Skip to content

[input @alpha.8-1] Setting bound FormControl to disabled causes valueAccessor.setDisabledState error #1171

@RoxKilly

Description

@RoxKilly

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Angular recommends, when using reactive forms, to set disabled on the FormControl rather than the input element in the template:
6

What is the current behavior?

Setting disabled: true on a FormControl bound to md-input will cause the app to crash with error:

TypeError: this.valueAccessor.setDisabledState is not a function

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:

nameCtrl = new FormControl({value:'Jane', disabled:true});

With

nameCtrl = new FormControl('Jane');

The error will go away

Which versions of Angular, Material, OS, browsers are affected?

Angular 2 rc 6 with Material alpha 8.1

Metadata

Metadata

Assignees

Labels

P2The issue is important to a large percentage of users, with a workaround

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions