mat-selection-list: selectAll and deselectAll methods should trigger selectionChange event
See original GitHub issueselectAll()
and deselectAll()
methods on MatSelectionList
should automatically trigger the selectionChange
event.
What is the use-case or motivation for this proposal?
Select some documents from a list.
The MatListOption
s have [value]
populated with an object containing a number of properties of the document (name, file size, last edited date, expiry date, etc.).
You want to communicate a warning to the user that specifies the number of expired documents in their current selection.
It’s easy enough to calculate the number of expired documents in the current selection when the selectionChange
event is fired, but if the user decides to selectAll
, this event is not triggered, so additional workarounds need to be made to cover this case.
Is there anything else we should know?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:5
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Select All mat option and deselect All - Stack Overflow
When user selects 4 options one by one then All shall be selected. HTML file <mat-select placeholder="User Type" formControlName="UserType" ...
Read more >Mat Selection List Select Deselect All No Selection ... - StackBlitz
List with selection does not fire selectionChange event when selecting/deselecting all values.
Read more >mat select selected Code Example - Code Grepper
mat select on select ; 1. <mat-form-field> ; 2. <mat-select placeholder="State" (selectionChange)="someMethod($event.value)"> ; 3. <mat-option * ...
Read more >Selectionchange Angular - Vela Cloud
You need to apply selectionChange on your mat-selection-list like this ... selectionChange event should. angular call function on option select. step by ...
Read more >Selectionchange Angular
In this article, we will implement a angular input field change event example. input ... Use selectionChange on the MatSelectionList instead. angular call ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What if you have a user interaction wired up to
selectAll
/deselectAll
?I think it would be nice to have the option to trigger this event without having to write extra code.
How about an optional extra parameter to the
selectAll
anddeselectAll
methods which would fire the event?E.g.
Seeing this now- I believe we should emit the event when the change comes from the user pressing Ctrl + A to trigger the select-all / deselect-all (but not when it happens programatically).