I am using Sweet Alert for a popup on my product view in an E-commerce Application with two buttons: one for going on cart View and another for reloading the vi
Use backdrop:true
with the allowOutsideClick: false
as following below. It worked for me.
swal({
backdrop:true,
allowOutsideClick: false,
title:'Warning!',
text:'Do you want to delete records?',
type:'warning',
showCancelButton: 0,
confirmButtonText: 'OK',
}).then(function(e) {
if (e.value) {
//do what you want
}
})