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

Fix: pre-filled text field can not be disabled #213

Merged
merged 1 commit into from
Apr 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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