fix buttons missing type="button"
Triggers unintentional form submits if missing `type` property.
This commit is contained in:
@@ -54,6 +54,7 @@
|
||||
/>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
{id}
|
||||
class={[
|
||||
'text-sui-text flex size-7 appearance-none items-center',
|
||||
|
||||
@@ -219,6 +219,7 @@
|
||||
{/if}
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
aria-label="close"
|
||||
class="absolute top-4 right-4 inline-flex cursor-pointer items-center
|
||||
justify-center disabled:cursor-not-allowed disabled:opacity-50"
|
||||
|
||||
@@ -334,6 +334,7 @@
|
||||
<!-- Back button -->
|
||||
{#if backButtonVisible}
|
||||
<button
|
||||
type="button"
|
||||
class="text-sui-text hover:text-sui-text-700 dark:text-sui-background dark:hover:text-sui-background/80 flex cursor-pointer items-center
|
||||
gap-2.5 font-medium transition-colors"
|
||||
onclick={() => (index -= 1)}
|
||||
|
||||
@@ -93,6 +93,7 @@
|
||||
{#each pages as page, i (page.title)}
|
||||
{@const active = activeIndex === i}
|
||||
<button
|
||||
type="button"
|
||||
bind:this={refs[i]}
|
||||
class={['-mb-[2px] cursor-pointer px-2']}
|
||||
onclick={() => {
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
{/if}
|
||||
|
||||
<button
|
||||
type="button"
|
||||
bind:this={ref}
|
||||
{...others}
|
||||
class={[
|
||||
|
||||
@@ -320,10 +320,17 @@
|
||||
</div>
|
||||
<div class="bg-sui-text/50 w-[1px] self-stretch"></div>
|
||||
<div class="flex items-center gap-1">
|
||||
<button class="item" title="Toggle Bold" aria-label="bold" {@attach boldToggle.attachment}>
|
||||
<button
|
||||
type="button"
|
||||
class="item"
|
||||
title="Toggle Bold"
|
||||
aria-label="bold"
|
||||
{@attach boldToggle.attachment}
|
||||
>
|
||||
<TextB size="1.25em" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="item"
|
||||
title="Toggle Italic"
|
||||
aria-label="italic"
|
||||
@@ -332,6 +339,7 @@
|
||||
<TextItalic size="1.25em" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="item"
|
||||
title="Toggle Underline"
|
||||
aria-label="underline"
|
||||
@@ -340,6 +348,7 @@
|
||||
<TextUnderline size="1.25em" />
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="item"
|
||||
title="Toggle Strikethrough"
|
||||
aria-label="strikethrough"
|
||||
@@ -414,7 +423,7 @@
|
||||
<input type="checkbox" id="darkmode" />
|
||||
<label for="darkmode">Dark mode</label>
|
||||
</div>
|
||||
<button class="rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600">
|
||||
<button type="button" class="rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600">
|
||||
Save Changes
|
||||
</button>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user