Prevent SweetAlert to be closed on clicking outside the popup window

前端 未结 13 716
不知归路
不知归路 2021-02-01 04:40

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

相关标签:
13条回答
  • 2021-02-01 05:08

    If you wan't want to close dialog on esc or outside click below is working for me.!

    swal({
      title: "Are you sure?",
      text: "You will not be able to recover this details!",
      icon: "warning",
      closeOnClickOutside: false,
      closeOnEsc: false,
      allowOutsideClick: false,
      buttons: [
        'No, cancel it!',
        'Yes, I am sure!'
      ],
      dangerMode: true,
    })
    
    0 讨论(0)
提交回复
热议问题