Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

Commit

Permalink
fix: pre-filled text field can not be disabled (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
tychenjiajun authored and matsp committed Apr 2, 2019
1 parent 3b40325 commit 2d55655
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion components/text-field/TextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export default {
computed: {
classes () {
return {
'mdc-text-field--disabled': this.disabled,
'mdc-text-field--upgraded': this.upgraded,
'mdc-text-field--fullwidth': this.fullWidth,
'mdc-text-field--with-leading-icon': this.$slots.leadingIcon,
Expand All @@ -126,6 +125,9 @@ export default {
},
value () {
this.mdcTextField.value = this.value
},
disabled () {
this.mdcTextField.disabled = this.disabled
}
},
mounted () {
Expand All @@ -138,6 +140,7 @@ export default {
this.mdcTextField = MDCTextField.attachTo(this.$el)
this.mdcTextField.useNativeValidation = this.useNativeValidation
this.mdcTextField.valid = this.valid
this.mdcTextField.disabled = this.disabled
},
beforeDestroy () {
this.slotObserver.disconnect()
Expand Down

0 comments on commit 2d55655

Please sign in to comment.