t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.4k stars 2.84k forks source link

Possibly a bug #709

Open tiagocborg opened 7 years ago

tiagocborg commented 7 years ago

I have found a bug, I think, while using a swal if confirm prompt.

When I call the method below, I can't navigate my HTML forms using the tab on my keyboard, the key tab simple stops working. When I use the standard JS confirm, my forms and my tab key works correctly.

I found a workaround, calling a location.reload(); after the method, but still...

Fell free to check my code. https://github.com/Pronjaboy/restful

`swal({ title: "Apagar cliente??", text: "Os dados do cliente serão apagados, não será possível desfazer!", type: "warning", showCancelButton: true, confirmButtonColor: "#DD6B55", confirmButtonText: "Sim, apagar!", cancelButtonText: "Não, cancelar!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm) { axios.delete('http://localhost:5000/clientes/'.concat(temp._id)) .then( response => { if(response.data || response.status != 404) { swal("Cliente deletado!", "Os dados do seu cliente foram apagados com sucesso.", "success"); document.getElementById('fechaClienteInfo').click(); clientes.splice(clientes.indexOf(temp),1); } clientes.splice(clientes.indexOf(temp),1);

                        })
                        .catch(function (error) {
                            console.log(error);
                        });
                } else {
                    swal("Cancelado!", "Os dados do cliente não foram alterados :)", "error");
                }
            });`
t4t5 commented 7 years ago

Could you try this in SweetAlert 2.0?