Skip to content

Commit

Permalink
Focus on element after fullscreen
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanaobrien committed Feb 3, 2024
1 parent 5e5df38 commit 869819f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion data/emulator.js
Original file line number Diff line number Diff line change
Expand Up @@ -1206,7 +1206,12 @@ class EmulatorJS {
this.elements.statePopupPanel.style["font-size"] = "28px";

//to fix a funny apple bug
this.addEventListener(window, "webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange", () => {setTimeout(this.handleResize.bind(this), 0)});
this.addEventListener(window, "webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange", () => {
setTimeout(() => {
this.handleResize.bind(this);
this.elements.parent.focus();
}, 0);
});
this.addEventListener(this.elements.parent, "dragenter", (e) => {
e.preventDefault();
if (!this.started) return;
Expand Down

0 comments on commit 869819f

Please sign in to comment.