Skip to content

Add values to Checkbox Group's value in order of selection #577

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

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

clintcs
Copy link
Collaborator

@clintcs clintcs commented Jan 3, 2025

🚀 Description

A minor detail to match Dropdown and because consumers likely expect us not to mess with the order of the values.

📋 Checklist

🔬 How to Test

  1. Navigate to Checkbox Group in Storybook.
  2. Check the second Checkbox.
  3. Check the third Checkbox.
  4. Check the first Checkbox.
  5. Verify Checkbox Group's value attribute is ["two", "three", "one"].
  6. Uncheck the third Checkbox.
  7. Verify Checkbox Group's value attribute is ["two", "one"].
  8. Check the third Checkbox.
  9. Verify Checkbox Group's value attribute is ["two", "one", "three"].

📸 Images/Videos of Functionality

N/A

Copy link

changeset-bot bot commented Jan 3, 2025

🦋 Changeset detected

Latest commit: ad80886

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@crowdstrike/glide-core Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Jan 3, 2025

@clintcs clintcs force-pushed the checkbox-group-value-order branch 2 times, most recently from fac88c5 to df0a1a1 Compare January 3, 2025 17:56
@clintcs clintcs force-pushed the checkbox-group-value-order branch from df0a1a1 to 552311b Compare January 3, 2025 17:58
@clintcs clintcs marked this pull request as ready for review January 3, 2025 18:06
this.value = this.value.filter((value) => {
return (
// No idea why TypeScript thinks `event.target` is possibly `null`
// when filtering given it's narrowed out above.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think you may be running into https://stackoverflow.com/a/79173023

Copy link
Collaborator Author

@clintcs clintcs Jan 3, 2025

Choose a reason for hiding this comment

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

Aha. I might just delete the comment. Any objections?

Copy link
Collaborator

Choose a reason for hiding this comment

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

nope!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ad80886

@clintcs clintcs merged commit c2f8678 into main Jan 3, 2025
7 checks passed
@clintcs clintcs deleted the checkbox-group-value-order branch January 3, 2025 20:09
@github-actions github-actions bot mentioned this pull request Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants