Skip to content

Commit

Permalink
fix(textfield): textarea model value ignored
Browse files Browse the repository at this point in the history
closes #215
  • Loading branch information
stasson committed Jan 19, 2018
1 parent 2a8c3a2 commit 737e391
Showing 1 changed file with 16 additions and 20 deletions.
36 changes: 16 additions & 20 deletions components/textfield/mdc-textfield.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,27 @@
<slot name="leading-icon">{{ hasLeadingIcon.content }}</slot>
</i>

<custom-element ref="input"
:tag="inputTag"
:type="inputType"
:name="name"
:rows="inputRows"
:cols="inputCols"
:value="value" @input="updateValue($event.target.value)"
<textarea ref="input" v-if="multiline"
:class="inputClasses"
:value="value"
@input="updateValue($event.target.value)"
:name="name"
:minlength="minlength" :maxlength="maxlength"
:placeholder="inputPlaceHolder"
:aria-label="inputPlaceHolder"
:aria-controls="inputAriaControls"
/>
:rows="rows" :cols="cols" ></textarea>

<input ref="input" v-else
:class="inputClasses"
:value="value"
@input="updateValue($event.target.value)"
:type="type"
:name="name"
:minlength="minlength" :maxlength="maxlength"
:placeholder="inputPlaceHolder"
:aria-label="inputPlaceHolder"
:aria-controls="inputAriaControls" />

<label ref="label" :class="labelClassesUpgraded" :for="_uid" v-if="hasLabel">
{{ label }}
Expand Down Expand Up @@ -150,18 +158,6 @@ export default {
}
},
computed: {
inputTag () {
return this.multiline ? 'textarea' : 'input'
},
inputType () {
return !this.multiline ? this.type : undefined
},
inputRows () {
return this.multiline ? this.rows : undefined
},
inputCols () {
return this.multiline ? this.cols : undefined
},
inputPlaceHolder () {
return this.fullwidth ? this.label : undefined
},
Expand Down

0 comments on commit 737e391

Please sign in to comment.