From 32510aa8a70275b2aa453be3e46ffb772d0fbf39 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Mon, 27 Apr 2026 19:30:56 +0200 Subject: [PATCH] Improve pointer lock element check in RuntimeHost --- src/runtime-three/runtime-host.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime-three/runtime-host.ts b/src/runtime-three/runtime-host.ts index 0b065167..2108b924 100644 --- a/src/runtime-three/runtime-host.ts +++ b/src/runtime-three/runtime-host.ts @@ -6734,7 +6734,7 @@ export class RuntimeHost { }; private shouldReserveEscapeForPointerLockRelease(): boolean { - if (document.pointerLockElement !== null) { + if (document.pointerLockElement === this.domElement) { return true; } @@ -6761,7 +6761,7 @@ export class RuntimeHost { this.previousPauseInputActive = false; if ( - document.pointerLockElement !== null && + document.pointerLockElement === this.domElement && typeof document.exitPointerLock === "function" ) { document.exitPointerLock();