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

uncaught exception: cancel #635

Closed
sastrahost opened this issue Dec 1, 2016 · 5 comments
Closed

uncaught exception: cancel #635

sastrahost opened this issue Dec 1, 2016 · 5 comments

Comments

@sastrahost
Copy link

This error will show when i click "cancel" button in Sweetalert2

swal({ title: menu_title, text: title, input: "text", showCancelButton: true, animation: "slide-from-top", showLoaderOnConfirm: true, inputPlaceholder: lang.write_your_comment, preConfirm: function(inputValue) { return new Promise(function(resolve, reject) { resolve('ok'); }); }) }, allowOutsideClick: false }).then(function(result){ var res = $.parseJSON(result); if(res.status){ swal({ title: lang.thankyou+"!", text: lang.your_feedback_sent, type: "success" }).then(function(confirm){ location.reload(); }); } else{ swal({ title: lang.sorry+"!", text: res.message, type: "warning" }); } });

@sastrahost
Copy link
Author

sastrahost commented Dec 1, 2016

when click close icon, it show error too,
uncaught exception: close

@t4t5
Copy link
Owner

t4t5 commented Sep 7, 2017

Should be posted here: https://limonte.github.io/sweetalert2/

@t4t5 t4t5 closed this as completed Sep 7, 2017
@eminx
Copy link

eminx commented Apr 1, 2018

In case someone comes here and gets stuck (because sweetalert != sweetalert2!)

At the end of the swal({...}), add this: .catch(() => swal.close())

Every promise function needs a failure callback.

@stzoran1
Copy link

stzoran1 commented Nov 9, 2019

@eminx you saved my day :)

@SantiM96
Copy link

@eminx me too!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants