primevue
primevue copied to clipboard
MultiSelect: Scroll to focused item on select
Describe the bug
Observed behaviour
Selecting an item in MultiSelect scrolls to focused item before setting new focus.
Reproducer
No response
PrimeVue version
3.17.0
Vue version
3.x
Language
ALL
Build / Runtime
Vue CLI App
Browser(s)
All
Steps to reproduce the behavior
- Go to https://www.primefaces.org/primevue/multiselect
- Click on any dropdown (best results with "Grouped")
- Scroll down to "Osaka" (for grouped example)
- Select "Osaka"
- List scrolls back to top (repeatable if you select others)
Expected behavior
Selecting an item in MultiSelect should select the item and keep me at the same scroll position
Okay, after playing around a bit more, I realized that this issue happens if the option autoOptionFocus
is true. (value is true
by default).
Solution
For anyone trying to fix this, you simply need to set autoOptionFocus
to false
. If you need to keep the autoOptionFocus on, then this will need to be addressed in PrimeVue.
Thanks a lot for your report! I'll check it and get back to you.