Fix some click propagation
This commit is contained in:
@@ -1,3 +1,15 @@
|
||||
<button on:click|stopPropagation type="button" {...$$props} class="text-left {$$props.class}">
|
||||
<slot />
|
||||
</button>
|
||||
<script lang="ts">
|
||||
export let type: "button" | "submit" = "button"
|
||||
|
||||
$: className = `text-left ${$$props.class}`
|
||||
</script>
|
||||
|
||||
{#if type === 'submit'}
|
||||
<button {...$$props} {type} class={className}>
|
||||
<slot />
|
||||
</button>
|
||||
{:else}
|
||||
<button on:click|stopPropagation|preventDefault {...$$props} {type} class={className}>
|
||||
<slot />
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user