Skip to content

Commit 7f2510f

Browse files
authored
Select: debounce query (#12181)
1 parent c5347b8 commit 7f2510f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/select/src/select.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@
6262
@compositionupdate="handleComposition"
6363
@compositionend="handleComposition"
6464
v-model="query"
65-
@input="e => handleQueryChange(e.target.value)"
66-
:debounce="remote ? 300 : 0"
65+
@input="debouncedQueryChange"
6766
v-if="filterable"
6867
:style="{ width: inputLength + 'px', 'max-width': inputWidth - 42 + 'px' }"
6968
ref="input">
@@ -849,6 +848,10 @@
849848
this.onInputChange();
850849
});
851850
851+
this.debouncedQueryChange = debounce(this.debounce, (e) => {
852+
this.handleQueryChange(e.target.value);
853+
});
854+
852855
this.$on('handleOptionClick', this.handleOptionSelect);
853856
this.$on('setSelected', this.setSelected);
854857
},

0 commit comments

Comments
 (0)