Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add 'type="button"' to prevent form submission #84

Merged
merged 1 commit into from
Jun 23, 2022

Conversation

flekschas
Copy link
Owner

Background

See #83

Currently Observed Behavior

When <Modal /> is wrapped by a <form />, clicking on the default close button submits the form

Demo: 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

@flekschas
Copy link
Owner Author

@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.

@flekschas flekschas added the bug Something isn't working label Jun 17, 2022
@jnysteen
Copy link
Contributor

Yes, this seems to fix it - thanks!

@flekschas flekschas merged commit d7b9371 into flekschas:master Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants