If you're using a <form> element inside a <dialog> element, you might want to consider setting its method attribute to dialog.
This will cause the dialog to close automatically on form submission and set the value of the submit button to dialog.returnValue. It will not actually submit the form though.
short: using method=dialog
If you're using a
<form>
element inside a<dialog>
element, you might want to consider setting itsmethod
attribute todialog
.This will cause the dialog to close automatically on form submission and set the value of the submit button to
dialog.returnValue
. It will not actually submit the form though.More details:
I learned about this from Dominik Reitz ner at the Svelte Vienna Meetup.