From 35b478e0b746bb75bd1a6f3f5bd87bbc952121de Mon Sep 17 00:00:00 2001 From: Hunter Johnston <64506580+huntabyte@users.noreply.github.com> Date: Thu, 29 Feb 2024 23:05:41 -0600 Subject: [PATCH] fix: Menu Radio Group change function conditional (#362) * fix: menu radio group equality issue * add changeset --- .changeset/tall-rivers-destroy.md | 5 +++++ src/lib/bits/menu/components/menu-radio-group.svelte | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/tall-rivers-destroy.md diff --git a/.changeset/tall-rivers-destroy.md b/.changeset/tall-rivers-destroy.md new file mode 100644 index 000000000..db69df523 --- /dev/null +++ b/.changeset/tall-rivers-destroy.md @@ -0,0 +1,5 @@ +--- +"bits-ui": patch +--- + +Menu Radio Group: fixed equality issue in change function condition diff --git a/src/lib/bits/menu/components/menu-radio-group.svelte b/src/lib/bits/menu/components/menu-radio-group.svelte index e6598cfd6..8e0cc0e28 100644 --- a/src/lib/bits/menu/components/menu-radio-group.svelte +++ b/src/lib/bits/menu/components/menu-radio-group.svelte @@ -17,7 +17,7 @@ } = setRadioGroupCtx({ defaultValue: value, onValueChange: ({ next }) => { - if (next && next !== value) { + if (next != null && next !== value) { onValueChange?.(next); value = next; }