Merge pull request #1824 from thecodingmachine/fix-focus-iframe

This commit is contained in:
_Bastler 2022-02-04 15:08:09 +01:00
parent c8d5fffcf0
commit 77cbc078ea
2 changed files with 7 additions and 10 deletions

View File

@ -27,14 +27,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) {

View File

@ -255,6 +255,11 @@ export class UserInputManager {
(pointer: Phaser.Input.Pointer, gameObjects: Phaser.GameObjects.GameObject[]) => {
this.joystick?.hide();
this.userInputHandler.handlePointerUpEvent(pointer, gameObjects);
// Disable focus on iframe (need by Firefox)
if (pointer.downElement.nodeName === "CANVAS" && document.activeElement instanceof HTMLIFrameElement) {
document.activeElement.blur();
}
}
);