so, I’m using sweetalert2 with laravel and I’m having a bug that the warning, question and info icons are duplicated. Aparently this is a known bug and should be already solved, but for what I’ve scearched, nothing helped me, so, if anyone could help me, I appreciate it.
I’m using sweetalert via jsdelivr(), I already tried to use a more recent version(instead of @9 I’ve already tested using @latest, @11, @10 and @9) and I’m using sweetalert2 with bootstrap.
This is my script in my Blade file, it is triggered by a button:
<script>
$(document).ready(function() {
$('#delete-btn').on('click', function(e){
e.preventDefault();
Swal.fire({
title: 'Danger!',
html: '<b>Are you sure?</b><br>' +
'<label for="checkboxConfirm">' +
'<input type="checkbox" id="conf"> Confirm'+
'</label>',
icon: "warning",
showCancelButton: true,
confirmButtonText: 'Remove',
cancelButtonText: 'Cancel',
preConfirm: () => {
const checkbox = document.getElementById('conf');
const isChecked = checkbox.checked;
return { isChecked: isChecked };
}
}).then((result) => {
if (result.isConfirmed) {
$('#loading').modal('show');
$.ajax({
// request logic
success: function(response){
$('#loading').modal('hide');
if (response.status === 'success'){
Swal.fire({
icon: 'success',
title: 'Success!',
text: response.message,
confirmButtonText: 'OK',
});
} else {
Swal.fire({
icon: 'error',
title: 'Erro!',
text: response.message,
confirmButtonText: 'OK'
});
}
}
})
}
})
})
});
</script>
This is what I’m getting when I try to use the warning icon. The info and question icon have similar issues
This is how it should be.