Skip to content

Commit

Permalink
fix: context menu closeOnItemClick (#421)
Browse files Browse the repository at this point in the history
  • Loading branch information
huntabyte committed Mar 26, 2024
1 parent e1c9709 commit 11b9c57
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-files-chew.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"bits-ui": patch
---

fix: context menu closeOnItemClick
3 changes: 3 additions & 0 deletions src/lib/bits/context-menu/components/context-menu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
export let closeFocus: $$Props["closeFocus"] = undefined;
export let disableFocusFirstItem: $$Props["disableFocusFirstItem"] = undefined;
export let onOutsideClick: $$Props["onOutsideClick"] = undefined;
export let closeOnItemClick: $$Props["closeOnItemClick"] = undefined;
const {
states: { open: localOpen },
Expand All @@ -34,6 +35,7 @@
disableFocusFirstItem,
closeFocus,
onOutsideClick,
closeOnItemClick,
onOpenChange: ({ next }) => {
if (open !== next) {
onOpenChange?.(next);
Expand All @@ -50,6 +52,7 @@
$: open !== undefined && localOpen.set(open);
$: updateOption("closeOnItemClick", closeOnItemClick);
$: updateOption("closeOnOutsideClick", closeOnOutsideClick);
$: updateOption("closeOnEscape", closeOnEscape);
$: updateOption("portal", portal);
Expand Down

0 comments on commit 11b9c57

Please sign in to comment.