Merge pull request #7299 from J-Michalek/fix/multi-select-filter-and-option-focus

fix(multi-select): autoFilterFocus and autoOptionFocus working together
pull/7377/head
Tuğçe Küçükoğlu 2025-03-04 15:37:44 +03:00 committed by GitHub
commit aeaf46189b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -738,6 +738,7 @@ export default {
this.scrollInView(); this.scrollInView();
this.autoFilterFocus && focus(this.$refs.filterInput.$el); this.autoFilterFocus && focus(this.$refs.filterInput.$el);
this.autoUpdateModel();
}, },
onOverlayAfterEnter() { onOverlayAfterEnter() {
this.bindOutsideClickListener(); this.bindOutsideClickListener();
@ -995,8 +996,11 @@ export default {
}); });
}, },
autoUpdateModel() { autoUpdateModel() {
if (this.selectOnFocus && this.autoOptionFocus && !this.$filled) { if (this.autoOptionFocus) {
this.focusedOptionIndex = this.findFirstFocusedOptionIndex(); this.focusedOptionIndex = this.findFirstFocusedOptionIndex();
}
if (this.selectOnFocus && this.autoOptionFocus && !this.$filled) {
const value = this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]); const value = this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]);
this.updateModel(null, [value]); this.updateModel(null, [value]);