Keep last selected option index
This commit is contained in:
parent
1376a01a72
commit
52cfcd662b
1 changed files with 5 additions and 1 deletions
|
@ -446,7 +446,6 @@
|
|||
if (this.disabled || this.autoComplete) {
|
||||
return false;
|
||||
}
|
||||
this.focusIndex = -1;
|
||||
|
||||
this.visible = typeof force !== 'undefined' ? force : !this.visible;
|
||||
if (this.visible){
|
||||
|
@ -571,6 +570,11 @@
|
|||
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());
|
||||
|
|
Loading…
Add table
Reference in a new issue