-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(list): selection list always firing change event for selectAll and deselectAll #11029
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
fix(list): selection list always firing change event for selectAll and deselectAll #11029
Conversation
src/lib/list/selection-list.ts
Outdated
* Sets the selected state on all of the options | ||
* and emits an event if anything changed. | ||
*/ | ||
private _toggleAll(isSelected: boolean) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about _setAllOptionsSelected
? To me "toggle" means specifically flipping from what it was before.
src/lib/list/selection-list.ts
Outdated
* and emits an event if anything changed. | ||
*/ | ||
private _toggleAll(isSelected: boolean) { | ||
let hasChanged = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment like
// Keep track of whether anything changed because we only want to emit
// a change event if something actually changed.
…d deselectAll Currently selection list will always fire its model change event when invoking `selectAll` and `deselectAll`, even if the state of any of the options hasn't changed. These changes ensure that it only gets fired when something has changed.
49ca718
to
f1a54f1
Compare
Addressed the feedback @jelbourn. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Currently selection list will always fire its model change event when invoking
selectAll
anddeselectAll
, even if the state of any of the options hasn't changed. These changes ensure that it only gets fired when something has changed.