Skip to content

Commit

Permalink
fix: Menu Radio Group change function conditional (#362)
Browse files Browse the repository at this point in the history
* fix: menu radio group equality issue

* add changeset
  • Loading branch information
huntabyte authored Mar 1, 2024
1 parent a973da3 commit 35b478e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/tall-rivers-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

Menu Radio Group: fixed equality issue in change function condition
2 changes: 1 addition & 1 deletion src/lib/bits/menu/components/menu-radio-group.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
} = setRadioGroupCtx({
defaultValue: value,
onValueChange: ({ next }) => {
if (next && next !== value) {
if (next != null && next !== value) {
onValueChange?.(next);
value = next;
}
Expand Down

0 comments on commit 35b478e

Please sign in to comment.