-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
p-multiselect: onChange event is not triggered for multiselect's filter select all/unselect all #14603
Comments
@mehmetcetin01140 @cetincakiroglu Any plans to review the PR and merge? |
@rosenthalj I came here to write up this very same bug, but happy to see it's written up so well. Thanks! Unfortunately, we've been facing a lot of bugs in the p-dropdown, p-multiselect, and p-autocomplete during this particular upgrade (from 16.0.2 to 17.5.0). I welcome the accessibility improvements, but sure hope these regression bugs get worked out sooner rather than later. Thanks to the PrimeNG team for all the effort you're putting in to fix things. |
To help quickly identify the cause of this issue and to save PrimeNG developers time searching/comparing code: PR #14604 is a simple fix that adds the missing call to onChange to multiselect's toggleAll method |
Describe the bug
When clicking the multiselect filter's select all (or unselect all) checkbox, the onChange event is not triggered. This worked in PrimeNG 15. This issue also brakes the table filter-menu demo when filtering the "agent" column using the multiselect filter.
The first video demonstrates this issue breaks the PrimeNG v17.x filter row demo
https://primeng.org/table#filter-row (Note: https://primeng.org/table#filter-menu is similarly broke)
Clicking the column filter's selectall/unselectall checkbox has no effect on the filter
multiselectVideo1Bad.mov
The second video demonstrates the PrimeNG v15 filter row demo working correctly
https://www.primefaces.org/primeng-v15-lts/table#filter-row
multiselectVideo2v15Good.mov
I created a reproducer to isolate the issue
The third video demonstrates that the onChange events are only triggered when the multiselect's individual filter checkboxes are clicked. The multiselect's onChange events are not sent when clicking the selectall/unselectall checkbox . The reproducer consists of a multiselect with filter and two output lists. The top output list displays the selected values stored in the multiselect's model. The bottom output list displays the selected values that are created by a listener to the multiselect's onChange events. In this video, if the multiselect was properly geenrating onChange events then both the top and bottom output lists would be the same regardless of what checkboxes were clicked.
multiselectVideo3Bad.mov
I compared the v15 and v17 multiselect code and it appears that a call to onChange.emit is missing from the toggleAll method;
this.onChange.emit({ originalEvent: event, value: this.value });
Environment
windows and maxos
Reproducer
https://stackblitz.com/edit/vr5hjz-sr3m4a
Angular version
17.x
PrimeNG version
17.3.3
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.18.1
Browser(s)
safari, chrome, firefox
Steps to reproduce the behavior
-- The "From Model" output list displays all cities (good)
-- The "From Listener" output list remains empty (bad)
Expected behavior
Both the "From Model" and "From Listener" output lists would each display a list of all the cities
The text was updated successfully, but these errors were encountered: