Browse Source

set the flag to false when needed

Raanan Weber 4 năm trước cách đây
mục cha
commit
2f5dbb3a41
2 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 1 0
      dist/preview release/what's new.md
  2. 1 1
      src/Inputs/scene.inputManager.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -11,5 +11,6 @@
 ## Bugs
 
 - Fix issue with the Promise polyfill where a return value was expected from resolve() ([Deltakosh](https://github.com/deltakosh))
+- Fix an issue with keyboard control (re)attachment. ([#9411](https://github.com/BabylonJS/Babylon.js/issues/9411)) ([RaananW](https://github.com/RaananW))
 
 ## Breaking changes

+ 1 - 1
src/Inputs/scene.inputManager.ts

@@ -816,7 +816,6 @@ export class InputManager {
         // Keyboard events
         this._onCanvasFocusObserver = engine.onCanvasFocusObservable.add(
             (() => {
-
                 if (document.activeElement === elementToAttachTo) {
                     attachedFunction();
                 }
@@ -898,6 +897,7 @@ export class InputManager {
         // Keyboard
         this._alreadyAttachedTo.removeEventListener("keydown", this._onKeyDown);
         this._alreadyAttachedTo.removeEventListener("keyup", this._onKeyUp);
+        this._keyboardIsAttached = false;
 
         // Cursor
         if (!this._scene.doNotHandleCursors) {