primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Component: MultiSelect with virtual scroll

Open mojesto opened this issue 1 year ago • 1 comments

Describe the bug

The bug occurs when a user searches in the multiselect component with virtual scroll and reaches a "No results found" state. Upon partially clearing the search term to bring back multiple results, the dropdown panel height does not automatically expand to display all results, remaining limited to a single row height.

Environment

MacOS, Chrome

Reproducer

No response

Angular version

18.2.11

PrimeNG version

17.18.11

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

20.11.1

Browser(s)

Chrome 130

Steps to reproduce the behavior

Open the multiselect virtual scroll demo at https://primeng.org/multiselect#virtualscroll.

  1. In the search input, type "emf" so that "No results found" appears.
  2. Then, delete the "f" from the search field.
  3. Despite many results now appearing, the dropdown panel height remains short, showing only one row.

Expected behavior

Dropdown panel automatically expands it's height to display multiple results

mojesto avatar Nov 07 '24 14:11 mojesto

In my case working solutions is:

Add @ViewChild('autoComplete') autoComplete: AutoComplete; In callback method onPanelShow i added a line: this.autoComplete.scroller.unbindResizeListener(); Function onResize in scroller component imo is the source of the problem and it is not needed in case of AutoComplete/MultiSelect components. Invoked function calculateAutoSize() is enough and call onResize just break the height of panel.

I have the same problem as reported in: https://github.com/primefaces/primeng/issues/16727

rgolonko avatar Nov 12 '24 09:11 rgolonko

Due to PrimeNG team's busy roadmap, this issue is available for anyone to work on. Make sure to reference this issue in your pull request. :sparkles: Thank you for your contribution! :sparkles:

github-actions[bot] avatar Nov 19 '24 11:11 github-actions[bot]