Skip to content

Commit

Permalink
fix: regression in use menu group state
Browse files Browse the repository at this point in the history
  • Loading branch information
segunadebayo committed Aug 29, 2022
1 parent cc0598d commit 732195d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-dogs-judge.md
@@ -0,0 +1,5 @@
---
"@chakra-ui/menu": patch
---

Fix regression in use menu group state
4 changes: 2 additions & 2 deletions packages/components/menu/src/use-menu.ts
Expand Up @@ -726,8 +726,8 @@ export function useMenuOptionGroup(props: UseMenuOptionGroupProps = {}) {

if (type === "checkbox" && Array.isArray(value)) {
const nextValue = value.includes(selectedValue)
? value.filter((eachItem) => eachItem !== selectedValue)
: [...selectedValue, selectedValue]
? value.filter((item) => item !== selectedValue)
: value.concat(selectedValue)

setValue(nextValue)
}
Expand Down

1 comment on commit 732195d

@vercel
Copy link

@vercel vercel bot commented on 732195d Aug 29, 2022

Choose a reason for hiding this comment

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

Please sign in to comment.