From 3bb2e318b199ce9b9eb5f7b4a0edb5c65437bc18 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Mon, 3 Feb 2025 22:33:22 +0100 Subject: [PATCH] Lib: Specify missing HTMLButtonAttributes explicitly --- src/lib/components/form/Button.svelte | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/src/lib/components/form/Button.svelte b/src/lib/components/form/Button.svelte index d239295..1966bdd 100644 --- a/src/lib/components/form/Button.svelte +++ b/src/lib/components/form/Button.svelte @@ -38,6 +38,15 @@ /** Additional classes to insert */ extraclass?: string; + + /** An optional onclick event for the button */ + onclick?: (event: Event) => void; + + /** An optional formaction for the button */ + formaction?: string; + + /** Optionally disable the button */ + disabled?: boolean; } let { @@ -51,6 +60,9 @@ trigger_popup = { event: "click", target: "invalid" }, shadow = false, extraclass = "", + onclick = () => {}, + formaction = undefined, + disabled = false, ...restProps }: ButtonProps = $props(); @@ -63,8 +75,11 @@ : ''} {activate_href && is_at_path(href) ? 'btn-hover' : ''} {shadow ? 'shadow' : ''} {extraclass}" - {...restProps}>{@render children()} + {@render children()} + {:else} + {@render children()} + {/if}