Preserving onfocus
Author: jts04Created Feb 22, 2017Updated Jan 14, 2026
Labelsbug
I'm currently using Sweetalert with Phaser, game engine.
Phaser works only when it gets focus of window. So there is a problem since Sweetalert change window.onfocus and doesn't restore that.
I guess the solution is simple :
- store its previous window.onfocus in constructor
- restore window.onfocus to previous version in 'sweetAlert.close' function
Source: t4t5/sweetalert