1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-24 07:12:57 +00:00

Making sure checkbox input is clickable without following the link

This commit is contained in:
2025-02-18 01:17:43 +04:00
parent dff77391b0
commit 62857d44c2

View File

@@ -22,10 +22,15 @@
onclick,
oninput,
}: MenuCheckboxItemProps = $props();
function stopPropagationAndPassCallback(originalEvent: MouseEvent) {
originalEvent.stopPropagation();
onclick?.(originalEvent as MouseEvent & { currentTarget: HTMLInputElement });
}
</script>
<MenuLink {href}>
<input bind:checked={checked} {name} {onclick} {oninput} type="checkbox" {value}>
<input bind:checked={checked} {name} onclick={stopPropagationAndPassCallback} {oninput} type="checkbox" {value}>
{@render children?.()}
</MenuLink>