Skip to content

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

@smarrerof

Description

@smarrerof

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
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Status: Needs TriageIssue will be reviewed by Core Team and a relevant label will be added as soon as possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions