Skip to content

Commit c718247

Browse files
authored
Update accordion to use the type button (#1004)
1 parent da29f25 commit c718247

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

src/lib/holocene/accordion.story.svelte

+13
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,17 @@
8080
<p>Accordion content here.</p>
8181
</Accordion>
8282
</Hst.Variant>
83+
84+
<Hst.Variant title="An Accordion in a form that doesn't submit the form">
85+
<form
86+
on:submit={() => {
87+
throw new Error("The form submitted and that's bad");
88+
}}
89+
>
90+
<Accordion title="Certificates" subtitle="Expires on Wed Feb 01, 2030">
91+
<Button class="!p-0" icon="info" variant="secondary" slot="action" />
92+
<p>Accordion content here.</p>
93+
</Accordion>
94+
</form>
95+
</Hst.Variant>
8396
</Hst.Story>

src/lib/holocene/accordion.svelte

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
aria-controls="{id}-content"
4747
class="accordion-open flex w-full flex-col"
4848
disabled={disabled || readOnly}
49+
type="button"
4950
on:click={toggleAccordion}
5051
>
5152
<div class="space-between flex w-full flex-row items-center">

0 commit comments

Comments
 (0)