Skip to content

Commit

Permalink
fix(MdField): prevent MdInput and MdTextarea from emit input events d…
Browse files Browse the repository at this point in the history
…irectly (#1285)

* (Fix #1261) Don't emit input directly in MdInput and MdTextarea

* use spread operator (+babel) instead of Object.assign for browser compatiblity
  • Loading branch information
korylprince authored and marcosmoura committed Dec 22, 2017
1 parent 89138eb commit 00832e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/components/MdField/MdInput/MdInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@
return this.type === 'password'
},
listeners () {
return {
...this.$listeners,
input: event => this.$emit('input', event.target.value)
}
var l = {...this.$listeners}
delete l.input
return l
}
},
watch: {
Expand Down
7 changes: 3 additions & 4 deletions src/components/MdField/MdTextarea/MdTextarea.vue
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,9 @@
},
computed: {
listeners () {
return {
...this.$listeners,
input: event => this.$emit('input', event.target.value)
}
var l = {...this.$listeners}
delete l.input
return l
},
textareaStyles () {
return {
Expand Down

0 comments on commit 00832e9

Please sign in to comment.