From a0e68a619bed225b231f832b8edd8c78e488585b Mon Sep 17 00:00:00 2001 From: J-Michalek Date: Sat, 22 Feb 2025 07:19:42 +0100 Subject: [PATCH] fix(multi-select): autoFilterFocus and autoOptionFocus working together --- packages/primevue/src/multiselect/MultiSelect.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/primevue/src/multiselect/MultiSelect.vue b/packages/primevue/src/multiselect/MultiSelect.vue index 9cd2bd6eaf..65279278df 100755 --- a/packages/primevue/src/multiselect/MultiSelect.vue +++ b/packages/primevue/src/multiselect/MultiSelect.vue @@ -738,6 +738,7 @@ export default { this.scrollInView(); this.autoFilterFocus && focus(this.$refs.filterInput.$el); + this.autoUpdateModel(); }, onOverlayAfterEnter() { this.bindOutsideClickListener(); @@ -995,8 +996,11 @@ export default { }); }, autoUpdateModel() { - if (this.selectOnFocus && this.autoOptionFocus && !this.$filled) { + if (this.autoOptionFocus) { this.focusedOptionIndex = this.findFirstFocusedOptionIndex(); + } + + if (this.selectOnFocus && this.autoOptionFocus && !this.$filled) { const value = this.getOptionValue(this.visibleOptions[this.focusedOptionIndex]); this.updateModel(null, [value]);