Skip to content

Commit

Permalink
fix(useCheckboxGroup): optimized the comparison for checked values
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolovlazar committed Feb 1, 2022
1 parent abcd48d commit 6187b66
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/checkbox/src/use-checkbox-group.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ export function useCheckboxGroup(props: UseCheckboxGroupProps = {}) {
const checkedKey = isNative ? "checked" : "isChecked"
return {
...props,
[checkedKey]:
value.includes(props.value) || value.includes(`${props.value}`),
[checkedKey]: value.some((val) => props.value == val),
onChange: handleChange,
}
},
Expand Down

0 comments on commit 6187b66

Please sign in to comment.