primevue icon indicating copy to clipboard operation
primevue copied to clipboard

MultiSelect: Scroll to focused item on select

Open blackjak231 opened this issue 1 year ago • 2 comments

Describe the bug

Observed behaviour

Selecting an item in MultiSelect scrolls to focused item before setting new focus.

ezgif-2-20a6833b8b

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

  1. Go to https://www.primefaces.org/primevue/multiselect
  2. Click on any dropdown (best results with "Grouped")
  3. Scroll down to "Osaka" (for grouped example)
  4. Select "Osaka"
  5. 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

blackjak231 avatar Sep 12 '22 11:09 blackjak231

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.

blackjak231 avatar Sep 12 '22 12:09 blackjak231

Thanks a lot for your report! I'll check it and get back to you.

mertsincan avatar Sep 12 '22 12:09 mertsincan