Closed flekschas closed 2 years ago
See #83
When <Modal /> is wrapped by a <form />, clicking on the default close button submits the form
<Modal />
<form />
Demo: https://svelte.dev/repl/dd87925ed7a64f08936257414fd63841?version=3.48.0
With the change, the close button has not default behavior and, thus, will not submit the form
Demo: https://svelte.dev/repl/7e3efb8138314975ad246a3a575a450b?version=3.48.0
@jnysteen Can you confirm that this change fixes the problem for you? In my tests, the fix worked and it seem to be good practice to set the button type in general.
Yes, this seems to fix it - thanks!
Background
See #83
Currently Observed Behavior
When
<Modal />
is wrapped by a<form />
, clicking on the default close button submits the formDemo: https://svelte.dev/repl/dd87925ed7a64f08936257414fd63841?version=3.48.0
New Behavior
With the change, the close button has not default behavior and, thus, will not submit the form
Demo: https://svelte.dev/repl/7e3efb8138314975ad246a3a575a450b?version=3.48.0