Skip to content

Commit

Permalink
Select: debounce query
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiyang committed Jul 31, 2018
1 parent 2bb9fd6 commit a27d9a7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/select/src/select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@
@compositionupdate="handleComposition"
@compositionend="handleComposition"
v-model="query"
@input="e => handleQueryChange(e.target.value)"
:debounce="remote ? 300 : 0"
@input="debouncedQueryChange"
v-if="filterable"
:style="{ width: inputLength + 'px', 'max-width': inputWidth - 42 + 'px' }"
ref="input">
Expand Down Expand Up @@ -849,6 +848,10 @@
this.onInputChange();
});
this.debouncedQueryChange = debounce(this.debounce, (e) => {
this.handleQueryChange(e.target.value);
});
this.$on('handleOptionClick', this.handleOptionSelect);
this.$on('setSelected', this.setSelected);
},
Expand Down

0 comments on commit a27d9a7

Please sign in to comment.