You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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
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 course135 === "135"
equates to false. This means on the UI the checkbox is never checked.A simple cast in the check will fix this issue.
The text was updated successfully, but these errors were encountered: