I recently integrated SweetAlert into my project and customized the buttons like this:
swal("A wild Pikachu appeared! What do you want to do?", {
buttons: {
cancel: "Run away!",
catch: {
text: "Throw Pokéball!",
value: "catch",
},
defeat: true,
},
onOpen: function() { console.log("Test") } // Unfortunately, this isn't functioning
})
.then((value) => { ... });
However, I noticed that upon initial opening, it automatically focuses on the last button. Is there a way to prevent this auto-focus behavior so that no button is focused when the alert opens initially?