fix debounce context

This commit is contained in:
Sergio Crisostomo 2017-09-08 08:19:04 +02:00
parent 1f41c9ca2c
commit 721dc69153

View file

@ -624,7 +624,8 @@
this.broadcast('iOption', 'on-query-change', val); this.broadcast('iOption', 'on-query-change', val);
} }
}, },
debouncedAppendRemove: debounce(function(){ debouncedAppendRemove(){
return debounce(function(){
if (!this.remote) { if (!this.remote) {
this.modelToQuery(); this.modelToQuery();
this.$nextTick(() => this.broadcastQuery('')); this.$nextTick(() => this.broadcastQuery(''));
@ -635,7 +636,8 @@
} }
this.slotChange(); this.slotChange();
this.updateOptions(true, true); this.updateOptions(true, true);
}), });
},
// remote // remote
updateLabel () { updateLabel () {
if (this.remote) { if (this.remote) {
@ -669,8 +671,8 @@
this.updateOptions(true); this.updateOptions(true);
document.addEventListener('keydown', this.handleKeydown); document.addEventListener('keydown', this.handleKeydown);
this.$on('append', this.debouncedAppendRemove); this.$on('append', this.debouncedAppendRemove());
this.$on('remove', this.debouncedAppendRemove); this.$on('remove', this.debouncedAppendRemove());
this.$on('on-select-selected', (value) => { this.$on('on-select-selected', (value) => {
if (this.model === value) { if (this.model === value) {