Prevent auto close sweet alert
See original GitHub issueTrying to do simple stuff. I do not want to close popup until user click on confirm button (I turned off this option but popup is still closing). Here is my code:
sweetAlert({
title: "Hello",
text: "<button type='button' class='btn btn-fb fb-share'>Share on Facebook</button>",
type: null,
confirmButtonText: "Close",
html: true,
closeOnConfirm: false, //It does close the popup when I click on close button
closeOnCancel: false,
allowOutsideClick: false
});
$(document).on( "click",".fb-share", function(e){
//here sweet alert closes when I press this button.
openFbPopup();
});
How do I prevent closing sweet alert?
Issue Analytics
- State:
- Created 8 years ago
- Reactions:6
- Comments:8
Top Results From Across the Web
Prevent SweetAlert to be closed on clicking outside the popup ...
If you are using Sweet Alert 2, you can use this configuration allowOutsideClick: false. This should work.
Read more >sweet alert prevent close Code Example - Code Grepper
how to stop user from clicking outside sweetalert 2. whatever by Outstanding Osprey on ... Answers related to “sweet alert prevent close”.
Read more >Timer Methods - SweetAlert2 example
let timerInterval Swal.fire({ title: 'Auto close alert!', html: 'I will close in <strong></strong> seconds.<br/><br/>' + '<button id="increase" class="btn ...
Read more >Sweet Alert worked, but it closes within seconds why?
Alert ::success('Data Deleted successfully')->autoClose(5000);. Or use the persistent() method if the user should close the alert: Copy Code
Read more >Docs - SweetAlert
Closes the currently open SweetAlert, as if you pressed the cancel button. swal.close(). getState, Get the state of the current SweetAlert modal. swal.getState ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I know this is late, but might help somebody in the future
@moazam1 The option has been changed to
https://sweetalert.js.org/docs/#closeonclickoutside
This didn’t worked.