Open Tamas-hi opened 2 weeks ago
The pull request from @KumJungMin is for opening the select. This is about closing it.
The following line in your code throws an error as filterInput is null:
focus(this.$refs.filterInput.$el);
primevue/packages/primevue/src/select/Select.vue
I do not think it should try and focus on the filter during onOverlayLeave
as the filterInput is not always there (null)
a comment there is to be resolved on line 693
this.autoFilterFocus && focus(this.$refs.filterInput.$el);
The following should be completely removed from onOverlayLeave
as there is no need to focus on the filterInput Element during Leave.
if (this.autoFilterFocus && this.filter) {
this.$nextTick(() => {
focus(this.$refs.filterInput.$el);
});
}
It is only needed in onOverlayEnter
Thought the same @1Map. Created a pull-request https://github.com/primefaces/primevue/pull/6546 but they considered fixing the focus feature. But in my opinion as well there seems no need to focus onLeave since the input isn't shown anyways. Better to focus the document instead, but I don't think it matters.
We'll see how it will be fixed.
Describe the bug
From v 4.10, the Select component throws an error when you click out of the dropdown, when auto-filter-focus is enabled.
<PrimeVueSelect v-model="customer" checkmark show-clear filter auto-filter-focus // this throws an error scroll-height="20rem" option-label="company_code" :options="customerOptions" :loading="customerOptionsLoading" :disabled="customerOptionsLoading" class="w-full" :invalid="Boolean(errors.customer)" v-bind="customerAttrs"
Reproducer
-
PrimeVue version
4.10
Vue version
4.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response