Fix overlay not closing on popstate (#10)
Fix overlay not closing when back/forward browser buttons used.
This commit is contained in:
1 parent
600f8a8eed
commit
087658cddf
1 file changed
+4
@@ -58,4 +58,8 @@ document.addEventListener("keydown", e => {
|
||||
if (e.keyCode === 27 && close(overlayCallback)) m.redraw();
|
||||
});
|
||||
|
||||
window.addEventListener("popstate", () => {
|
||||
if (close(overlayCallback)) m.redraw();
|
||||
});
|
||||
|
||||
export { open, close, render };
|
||||
Reference in new issue
Block a user