Skip to content

Commit

Permalink
Merge pull request #2719 from XiaoMi/hotfix/2716(checkbox)
Browse files Browse the repository at this point in the history
fix(checkbox): 修复 null 传值问题 (#2716)
  • Loading branch information
solarjoker authored Jan 17, 2024
2 parents adf35af + 97c8267 commit 29f628d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/poor-apples-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/checkbox": patch
---

fix: 修复组合下 null 传值问题
5 changes: 5 additions & 0 deletions .changeset/silent-geckos-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@hi-ui/hiui": patch
---

fix(checkbox): 修复组合下 null 传值问题
2 changes: 1 addition & 1 deletion packages/ui/checkbox/src/CheckboxGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const CheckboxGroup = forwardRef<HTMLDivElement | null, CheckboxGroupProp
},
ref
) => {
const [value, tryChangeValue] = useUncontrolledState(defaultValue, valueProp, onChange)
const [value, tryChangeValue] = useUncontrolledState(defaultValue, valueProp ?? [], onChange)

const handleChange = useLatestCallback(
(evt: React.ChangeEvent<HTMLInputElement>, targetId: React.ReactText | undefined) => {
Expand Down

0 comments on commit 29f628d

Please sign in to comment.