From 435ae6e33623830b7a4eefb0ac1301f7bc97a396 Mon Sep 17 00:00:00 2001 From: TaylorDale <5500716+TaylorDale@users.noreply.github.com> Date: Mon, 10 Dec 2018 12:10:50 +1000 Subject: [PATCH] Only emit input on actual input events Seperated it from the change event, which will still occur upon any change of value (programmatic, user, whathaveyou) --- src/components/Select.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/Select.vue b/src/components/Select.vue index 8f618db..372cd7f 100644 --- a/src/components/Select.vue +++ b/src/components/Select.vue @@ -566,7 +566,14 @@ onChange: { type: Function, default: function (val) { - this.$emit('input', val) + this.$emit('change', val); + } + }, + + onInput: { + type: Function, + default: function (val) { + this.$emit('input', val); } }, @@ -830,6 +837,7 @@ } else { this.mutableValue = option } + this.onInput(this.mutableValue); } this.onAfterSelect(option) @@ -853,6 +861,7 @@ } else { this.mutableValue = null } + this.onInput(this.mutableValue); }, /** @@ -861,6 +870,7 @@ */ clearSelection() { this.mutableValue = this.multiple ? [] : null + this.onInput(this.mutableValue) }, /**