I'm using an input SweetAlert to password-protect certain user settings. These settings live on a page with a multiple forms and multiple "save" buttons. Users enter their password into the alert that is launched by hitting any of the settings page's save buttons and then, if the password is correct, their settings update to reflect what they have changed on the page.
For some reason, the sweetalert performs as expected when the "save" buttons are clicked, but not when enter is hit in the form fields. When enter is hit in a form field, the modal behaves as if the confirm button has already been pressed and my debugger shows that I am already in the promise that specifies what to do after the confirm button is pressed
This exact functionality worked just fine in sweetalert 1.x. I'm in the process up updating our sweetalerts from 1.x to 2.x, and this is the only thing keeping me from finishing this upgrade. Adding a 100ms timeout around the sweetalert solves this problem, but that feels hacky. What can I do to stop this from happening?
I'm using an input SweetAlert to password-protect certain user settings. These settings live on a page with a multiple forms and multiple "save" buttons. Users enter their password into the alert that is launched by hitting any of the settings page's save buttons and then, if the password is correct, their settings update to reflect what they have changed on the page.
For some reason, the sweetalert performs as expected when the "save" buttons are clicked, but not when enter is hit in the form fields. When enter is hit in a form field, the modal behaves as if the confirm button has already been pressed and my debugger shows that I am already in the promise that specifies what to do after the confirm button is pressed
This exact functionality worked just fine in sweetalert 1.x. I'm in the process up updating our sweetalerts from 1.x to 2.x, and this is the only thing keeping me from finishing this upgrade. Adding a 100ms timeout around the sweetalert solves this problem, but that feels hacky. What can I do to stop this from happening?