primeng icon indicating copy to clipboard operation
primeng copied to clipboard

p-multiselect with virtualScroll shows empty list after reopening until scroll is triggered

Open smarrerof opened this issue 1 month ago • 2 comments

Describe the bug

When virtualScroll is enabled in the p-multiselect component (and possibly p-select as well), after selecting one or more elements and closing the component, reopening it shows an empty list. The items only appear after the user manually scrolls the list.

This issue affects the user experience as it gives the impression that the options have disappeared or that something is broken in the component.

Pull Request Link

No response

Reason for not contributing a PR

  • [ ] Lack of time
  • [x] Unsure how to implement the fix/feature
  • [ ] Difficulty understanding the codebase
  • [ ] Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/wbxnfrkb

Environment

Windows 11 Enterprise Version 24H2 (OS Build 26100.7171)

Angular version

20.3.13

PrimeNG version

v20

Node version

22.21.1

Browser(s)

Chrome Version 142.0.7444.176

Steps to reproduce the behavior

  1. Open the reproducer link: https://stackblitz.com/edit/wbxnfrkb
  2. Expand the p-multiselect component (the list of elements displays correctly)
  3. Select one or more elements from the list
  4. Close the dropdown component
  5. Reopen the dropdown component
  6. BUG: The list appears empty - no items are visible
  7. Scroll the list manually
  8. WORKAROUND: Items become visible after scrolling

Expected behavior

When reopening the p-multiselect component with virtualScroll enabled, all items should be visible immediately without requiring the user to scroll first. The component should maintain the correct scroll position or properly render the visible items in the virtual scroll viewport.

Image Image

smarrerof avatar Dec 04 '25 07:12 smarrerof

https://github.com/primefaces/primeng/issues/19078

szlezakbartosz avatar Dec 04 '25 20:12 szlezakbartosz

Thank you for sharing the ticket szlezakbartosz

Hello, if this helps, I started a discussion with a solution that works for TreeSelect with the same issues as MultiSelect. But I never received a response from them

If you are interested https://github.com/orgs/primefaces/discussions/4365

Wingelo avatar Dec 05 '25 08:12 Wingelo