1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-23 23:02:58 +00:00

Making sure radio input is clickable without following the link

This commit is contained in:
2025-02-18 01:14:44 +04:00
parent 5a07fa3d60
commit dff77391b0

View File

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