Skip to content

Commit

Permalink
fix: show textfield in disabled state when native input is disabled
Browse files Browse the repository at this point in the history
Fixes #102
  • Loading branch information
gjdev committed Dec 4, 2017
1 parent 0f641ee commit 832a4b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions bundle/src/components/text-field/mdc.text-field.directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -471,4 +471,11 @@ export class MdcTextFieldDirective extends AbstractMdcRipple implements AfterCon
"Change the content of the mdcTextFieldHelperText instead.")
this._helperText = helperText;
}

@HostBinding('class.mdc-text-field--disabled') get _disabled() {
// TODO: this mirrors what the text-field can update itself from adapter.getNativeInput
// is there a way to trigger the textfield to re-read that when the disabled state of
// the input changes?
return this._input ? this._input.disabled : false;
}
}

0 comments on commit 832a4b2

Please sign in to comment.