Skip to content

Commit

Permalink
button menu propagates click and onChange is called when closed
Browse files Browse the repository at this point in the history
  • Loading branch information
petemill committed Dec 12, 2024
1 parent d699e84 commit 06bbaa8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/buttonMenu/buttonMenu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
const close: CloseEvent = (e) => {
if (isOpen === undefined) isOpenInternal = false
onChange?.({ isOpen: false })
onClose?.(e)
}
</script>
Expand All @@ -44,7 +45,7 @@
firing a `click` event. This may be triggered with a keypress or click.
-->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<div bind:this={anchor} on:click|stopPropagation={toggle}>
<div bind:this={anchor} on:click={toggle}>
<slot name="anchor-content"/>
</div>
<Menu {positionStrategy} isOpen={isOpenInternal} target={anchor} onClose={close}>
Expand Down

0 comments on commit 06bbaa8

Please sign in to comment.