bestguy / sveltestrap

Bootstrap 4 & 5 components for Svelte
https://sveltestrap.js.org
MIT License
1.31k stars 183 forks source link

Accordion nested inside a form will submit on expand/collapse #349

Open lgirma opened 3 years ago

lgirma commented 3 years ago

Problem:

Suppose I have a form with an Accordion component nested inside. When I expand or collapse using the accordion's header, the form will automatically be submitted. This is because of the <button> element inside AccordionItem has no type attribute specified.

Possible fix:

Set the button type attribute inside the AccordionHeader as type="button"

bestguy commented 3 years ago

Thanks for the catch. I can take a look or PR welcome as well.

lgirma commented 3 years ago

@bestguy Sure. Will create a PR later.