t4t5 / sweetalert

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

Close event not working as expected when change browser's tab #949

Open minhthien309 opened 3 years ago

minhthien309 commented 3 years ago

Current behavior

Hello everyone, i'm using sweetalert 2.1.2 but i'm having an issue: The trigger close is working fine if I didn't change tab. But when the sweetalert is showing and changing browser's tab and return back the sweetalert won't close

Expected behavior

Event close working when changing browser's tab

This is my code

image

When I use swal.getState() and focus on page, isOpen state return true; but if I go to another tab and return back, the isOpen return false even the swal still show