erge remote-tracking branch 'iview/2.0' into 2.0_upgrade

This commit is contained in:
jilen 2020-02-24 09:42:15 +08:00
commit 6d36ba64da

View file

@ -662,17 +662,23 @@
}
this.isFocused = true; // so we put back focus after clicking with mouse on option elements
} else {
this.query = '';
this.query = String(option.label).trim();
this.values = [option];
this.lastRemoteQuery = '';
this.hideMenu();
}
this.focusIndex = this.flatOptions.findIndex((opt) => {
if (!opt || !opt.componentOptions) return false;
return opt.componentOptions.propsData.value === option.value;
});
if (this.filterable){
const inputField = this.$el.querySelector('input[type="text"]');
if (!this.autoComplete) this.$nextTick(() => inputField.focus());
}
this.$emit('on-select', option); // # 4441
this.broadcast('Drop', 'on-update-popper');
this.$emit('on-select', this.publicValue); // # 4441
setTimeout(() => {
this.filterQueryChange = false;
}, ANIMATION_TIMEOUT);