From 00832e9a521191c88c69832e184f514e821c38db Mon Sep 17 00:00:00 2001 From: Kory Prince Date: Fri, 22 Dec 2017 15:53:59 -0600 Subject: [PATCH] fix(MdField): prevent MdInput and MdTextarea from emit input events directly (#1285) * (Fix #1261) Don't emit input directly in MdInput and MdTextarea * use spread operator (+babel) instead of Object.assign for browser compatiblity --- src/components/MdField/MdInput/MdInput.vue | 7 +++---- src/components/MdField/MdTextarea/MdTextarea.vue | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/components/MdField/MdInput/MdInput.vue b/src/components/MdField/MdInput/MdInput.vue index f88e0bcbd..46e7a0ac5 100644 --- a/src/components/MdField/MdInput/MdInput.vue +++ b/src/components/MdField/MdInput/MdInput.vue @@ -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: { diff --git a/src/components/MdField/MdTextarea/MdTextarea.vue b/src/components/MdField/MdTextarea/MdTextarea.vue index b04f08879..8fc470d11 100644 --- a/src/components/MdField/MdTextarea/MdTextarea.vue +++ b/src/components/MdField/MdTextarea/MdTextarea.vue @@ -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 {