Fix game unfocusable after clicking on iframe
This commit is contained in:
parent
2232f7caf4
commit
6863fa3764
@ -26,15 +26,6 @@ export class Game extends Phaser.Game {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/*window.addEventListener('resize', (event) => {
|
|
||||||
// Let's trigger the onResize method of any active scene that is a ResizableScene
|
|
||||||
for (const scene of this.scene.getScenes(true)) {
|
|
||||||
if (scene instanceof ResizableScene) {
|
|
||||||
scene.onResize(event);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public step(time: number, delta: number) {
|
public step(time: number, delta: number) {
|
||||||
|
@ -255,6 +255,11 @@ export class UserInputManager {
|
|||||||
(pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[]) => {
|
(pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[]) => {
|
||||||
this.joystick?.hide();
|
this.joystick?.hide();
|
||||||
this.userInputHandler.handlePointerUpEvent(pointer, gameObjects);
|
this.userInputHandler.handlePointerUpEvent(pointer, gameObjects);
|
||||||
|
|
||||||
|
// Disable focus on iframe (need by Firefox)
|
||||||
|
if (pointer.downElement.nodeName === "CANVAS" && document.activeElement instanceof HTMLIFrameElement) {
|
||||||
|
document.activeElement.blur();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user