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

SQFormCheckboxGroup options don't properly compare values that are not strings #231

Closed
20BBrown14 opened this issue May 7, 2021 · 0 comments · Fixed by #232
Closed

SQFormCheckboxGroup options don't properly compare values that are not strings #231

20BBrown14 opened this issue May 7, 2021 · 0 comments · Fixed by #232
Assignees

Comments

@20BBrown14
Copy link
Contributor

Affected Components: SQFormCheckboxGroup

I've found that if you provide a value that is not a string for a checkbox option in a SQFormCheckboxGroup component then check the group does, to determine if a specific checkbox is checked, fails. This is beacuse MUI casts the value prop of the checkbox to a string. So if you provide a number or boolean it'll be cast a string and of course 135 === "135" equates to false. This means on the UI the checkbox is never checked.

A simple cast in the check will fix this issue.

@20BBrown14 20BBrown14 self-assigned this May 7, 2021
20BBrown14 added a commit that referenced this issue May 7, 2021
SQFormCheckboxGroup's MUI Checkbox casts the value to a string and as a
result the isChecked comparison fails if a non-string value was passed.
A simple cast in our own code fixes this issue.

✅ Closes: #231
SeanGroff pushed a commit that referenced this issue May 7, 2021
### [4.5.7](v4.5.6...v4.5.7) (2021-05-07)

### Bug Fixes

* 🐛 SQFormCheckboxGroup properly accepts non string values ([3e1dc1c](3e1dc1c)), closes [#231](#231)
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 a pull request may close this issue.

1 participant