Skip to content

Commit

Permalink
Merge pull request #7282 from J-Michalek/fix/select-filter-and-option…
Browse files Browse the repository at this point in the history
…-focus

fix(select): autoFilterFocus and autoOptionFocus working together
  • Loading branch information
tugcekucukoglu authored Feb 20, 2025
2 parents 0bebec7 + 6d8aa45 commit 73bfa10
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/primevue/src/select/Select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ export default {
setTimeout(() => {
this.autoFilterFocus && this.filter && focus(this.$refs.filterInput.$el);
this.autoUpdateModel();
}, 1);
},
onOverlayAfterEnter() {
Expand Down Expand Up @@ -925,8 +926,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) {
this.onOptionSelect(null, this.visibleOptions[this.focusedOptionIndex], false);
}
},
Expand Down

0 comments on commit 73bfa10

Please sign in to comment.