Open ghost opened 6 years ago
I think this is a bug, the button just keeps loading in the second request after firing the stopLoading() method, here's the code:
swal("Change Password", "Enter your desired new password:", { content: { element: "input", attributes: { placeholder: "New password", type: "password", }, }, button: { text: "Submit", closeModal: false, } }) .then((value) => { if (value == "") { iziToast.show({ icon: "fa fa-exclamation-circle", title: 'Warning', message: 'Password cannot be empty!', position: "topLeft" }); swal.stopLoading(); } else { $.ajax({ url: site_url + "/ajaxMain/forgot/?newpassword=" + value, type: "GET", success: function(result) { var data = JSON.parse(result); if (data.status === "success") { swal({ title: "Success!", text: "Your password has been successfully changed! Logging in..", icon: "success", closeOnClickOutside: false, button: false }); setInterval(function() { window.location = site_url; }, 3000); } else { swal("Change Failed", "Something went wrong while trying to change your password!", "error"); } } }); } });
https://github.com/t4t5/sweetalert/issues/795
I think this is a bug, the button just keeps loading in the second request after firing the stopLoading() method, here's the code: