I have a simple SweetAlert2 dialog box that asks the user for their name. I want it so that the user has to enter something to close the box. I tried the top solution for this StackOverflow question but it doesn't work and I am still able to exit the box by clicking out. Here's my code.
var output;
function getInput(question) {
swal(question, {
allowOutsideClick: false,
content: "input",
}).then((value) => {
output=value;
});
}
getInput("Enter your name");