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:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user