2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-10 07:52:23 +03:00

fix: emit input event only if there is val to be deleted (#1038)

This commit is contained in:
andreas
2020-03-16 04:17:25 +02:00
committed by GitHub
parent 0bad820f91
commit eedda74d43
2 changed files with 27 additions and 17 deletions
+2 -2
View File
@@ -819,7 +819,7 @@
* @return {this.value}
*/
maybeDeleteValue() {
if (!this.searchEl.value.length && this.selectedValue && this.clearable) {
if (!this.searchEl.value.length && this.selectedValue && this.selectedValue.length && this.clearable) {
let value = null;
if (this.multiple) {
value = [...this.selectedValue.slice(0, this.selectedValue.length - 1)]
@@ -939,7 +939,7 @@
};
const defaults = {
// delete
// backspace
8: e => this.maybeDeleteValue(),
// tab
9: e => this.onTab(),