Skip to content

Commit 435ae6e

Browse files
committed
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)
1 parent 623df81 commit 435ae6e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/components/Select.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,14 @@
566566
onChange: {
567567
type: Function,
568568
default: function (val) {
569-
this.$emit('input', val)
569+
this.$emit('change', val);
570+
}
571+
},
572+
573+
onInput: {
574+
type: Function,
575+
default: function (val) {
576+
this.$emit('input', val);
570577
}
571578
},
572579
@@ -830,6 +837,7 @@
830837
} else {
831838
this.mutableValue = option
832839
}
840+
this.onInput(this.mutableValue);
833841
}
834842
835843
this.onAfterSelect(option)
@@ -853,6 +861,7 @@
853861
} else {
854862
this.mutableValue = null
855863
}
864+
this.onInput(this.mutableValue);
856865
},
857866
858867
/**
@@ -861,6 +870,7 @@
861870
*/
862871
clearSelection() {
863872
this.mutableValue = this.multiple ? [] : null
873+
this.onInput(this.mutableValue)
864874
},
865875
866876
/**

0 commit comments

Comments
 (0)