MultiSelect Component: onSelectAllChange() logic in VirtualScroll is incorrect (filter perspective is missing). #15294
Labels
Status: Needs Triage
Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Describe the bug
When VirtualScroll is not incorporated in the Multiselect, the onSelectAllChange logic functions as expected. Specifically, clicking on the header checkbox results in the selection of only the valid options, even after applying filters.
However, when VirtualScroll is implemented to enhance the Multiselect's performance, a discrepancy arises. The onSelectAllChange() logic seems to mark all items present in the list as selected, regardless of the applied filters.
Expected Behavior
The anticipated behavior is for the logic to determine whether filtering has been applied or not. If filters are present, then only the visible and valid options should be selected or deselected. This functionality aligns with the actual behavior of Multiselect without VirtualScroll in version 17.11.0. The expectation is for this to handle both selection and deselection scenarios appropriately.
Actual Behavior
The implemented logic selects/deselects all the items in the options list, even with filters.
Environment
Angular CLI: 17.3.3
Angular: 17.3.2
Node: 20.9.0
zone.js: 0.14.4
Typescript: 5.2.2
Package Manager: npm 10.1.0
OS: win32 x64
Reproducer
No response
Angular version
17.3.2
PrimeNG version
17.11.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.9.0
Browser(s)
No response
Steps to reproduce the behavior
Expected behavior
The anticipated behavior is for the SelectAll checkbox to only select/deselect the visible options in the dropdown list, provided a filter is applied. The SelectAll checkbox should not affect items that do not match the applied filter criteria.
The text was updated successfully, but these errors were encountered: