diff --git a/src/lib/components/controls/contextmenu/ContextMenuDropDownButton.svelte b/src/lib/components/controls/contextmenu/ContextMenuDropDownButton.svelte index 64a0ed17..43aa658d 100644 --- a/src/lib/components/controls/contextmenu/ContextMenuDropDownButton.svelte +++ b/src/lib/components/controls/contextmenu/ContextMenuDropDownButton.svelte @@ -7,9 +7,17 @@ export let item: MenuDropDownButton export let className: string | undefined = undefined export let onCloseContextMenu: () => void + + $: items = item.items.map(item => ({ + ...item, + onClick: (event: MouseEvent) => { + onCloseContextMenu() + item.onClick(event) + } + })) - +