Skip to content

Commit

Permalink
fix: enable focus when game is in iframe
Browse files Browse the repository at this point in the history
  • Loading branch information
djcsdy committed Sep 28, 2022
1 parent f386f0c commit d43bcd1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ domready(() => {
engine.canvas.style.imageRendering = "crisp-edges";
}

engine.canvas.setAttribute("tabindex", "-1");

function scale(): void {
const scaleFactor = Math.floor(Math.min(
window.innerWidth / game.width,
Expand Down Expand Up @@ -85,4 +87,4 @@ domready(() => {
window.addEventListener("blur", onBlur, true);

game.start();
});
});

0 comments on commit d43bcd1

Please sign in to comment.