Skip to content
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

feat(button-group): clear selection via selectedItems #1168

Merged
merged 4 commits into from
Apr 18, 2024

Conversation

RivaIvanova
Copy link
Member

Closes #1041

Copy link
Member

@rkaraivanov rkaraivanov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with one nitpick.

Also, please add a changelog entry with the feature.

Comment on lines 112 to 115
if (values) {
this._selectedItems = new Set(values);
this.setSelection(this._selectedItems);
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (values) {
this._selectedItems = new Set(values);
this.setSelection(this._selectedItems);
}
this._selectedItems = new Set(Array.isArray(values) ? values : []);
this.setSelection(this._selectedItems);

This would also work when assigning falsy values, i.e. null/undefined.
You can add a test case for that as well.

@rkaraivanov rkaraivanov merged commit e127ee7 into master Apr 18, 2024
5 checks passed
@rkaraivanov rkaraivanov deleted the rivanova/feat-1041 branch April 18, 2024 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants