-
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
Component: MultiSelect (p-multiSelect) no longer emits an event when all items are selected or deselected #14252
Comments
There is also an issue when filtering, and then selecting all of the filtered items, where this |
You need to include the [selectAll]="selectAll" in your code |
I've tried that input, when |
In the SelectAll function, you need to make the "selectAll" variable set to the "event.checked" value to control the display. If you want all the checkboxes to appear you'll also need to select those that are in the NgModel. Check out this updated stackblitz: |
Hi, |
This almost addresses the problem, but in your Stackblitz version I noticed if you reduce the list of items shown by using the filter, then click the top-most check box, it still selects all items in the list. The previous version of the MultiSelect component didn't work this way. It would only check the boxes of the visible items in the filtered list. The MultiSelect component seems to have become more cumbersome to use. It didn't use to be necessary to write code to handle selecting all items in the list. Am I missing something here? I see now in the component's documentation under the VirtualScroll section it makes use of the |
i user the onselectallchange event but dont works too |
Why do i as the consumer need to handle the selectAll logic? This needs to be handled by the component. If i click the selectAll checkbox i want all the options to be selected and the model to be updated. |
I've just found this issue,. I see there is already a fix pending to be merged. Thanks @jim-heath and @rosenthalj |
Can I know when it will be merged and what version will fix this? |
I think you can use (ngModelChange) to handle the problem |
Thank you for your explanation but the documents should have this explanation too. |
yes its works. Thanks |
Describe the bug
I updated my project from Angular 16.1.5 to 17.0.3 and PrimeNG 16.0.2 to 16.4.2. I use the MultiSelect component among many other great components from PrimeNG but noticed the
onChange
event is no longer being emitted when clicking the check box to select all items in the list or when deselecting them all.I reviewed the documentation for PrimeNG and found a new event called
onSelectAllChange
and figured that was my problem, but this event never gets emitted when selecting/deselecting all items.I also tried updating to various PrimeNG releases after 16.4.2 through 17.0.0-rc.1 and they all have this issue. I returned to PrimeNG 16.0.2 for the time being until this issue is resolved.
I provided a link to a StackBlitz project reproducing the issue but I'd be happy to provide more information if needed.
Environment
Angular app with PrimeNG
Reproducer
https://stackblitz.com/edit/angular-znfmqm-6vy1k6?file=src%2Fapp%2Fdemo%2Fmuilti-select-basic-demo.html
Angular version
17.0.3
PrimeNG version
16.9.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.10.0
Browser(s)
Firefox 120.0, Chrome 119.0.6045.200
Steps to reproduce the behavior
Connect the
onChange
and/oronSelectAllChange
to event handlers in your component.Expected behavior
The
onChange
event oronSelectAllChange
event should be emitted from the MultiSelect component when the check box at the top of the list is checked or unchecked.The text was updated successfully, but these errors were encountered: