yarn sweetalert2 7.11.0
Allow preConfirm to prevent dialog closing

latest releases: 11.11.0, 11.10.8, 11.10.7...
6 years ago

Thanks to @dchekanov who raised the issue #896, now it's possible to prevent a dialog from being closed by returning false in the preConfirm parameter function.

Example:

preConfirm: function() {
  if (!confirm('Are you sure?')) {
    return false;
  }
  // proceed otherwise
}

or even shorter with ES6:

preConfirm: () => confirm('Are you sure?')

jsfiddle: https://jsfiddle.net/ad3quksn/386/

Don't miss a new sweetalert2 release

NewReleases is sending notifications on new releases.