Bläddra i källkod

Merge pull request #5382 from TrevorDev/inputRefocusNotWorking

Input refocus not working
David Catuhe 6 år sedan
förälder
incheckning
0094678c9a
3 ändrade filer med 573 tillägg och 561 borttagningar
  1. 1 0
      dist/preview release/what's new.md
  2. 570 559
      gui/src/2D/controls/inputText.ts
  3. 2 2
      src/babylon.scene.ts

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

@@ -56,6 +56,7 @@
 ### Materials Library
 
 ## Bug fixes
+- Refocusing on input gui with pointer events ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine
 - Fixed a bug with `mesh.alwaysSelectAsActiveMesh` preventing layerMask to be taken in account ([Deltakosh](https://github.com/deltakosh))

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 570 - 559
gui/src/2D/controls/inputText.ts


+ 2 - 2
src/babylon.scene.ts

@@ -2005,6 +2005,8 @@ module BABYLON {
                 }
 
                 this._initClickEvent(this.onPrePointerObservable, this.onPointerObservable, evt, (clickInfo: ClickInfo, pickResult: Nullable<PickingInfo>) => {
+                    this._pointerCaptures[evt.pointerId] = false;
+
                     // PreObservable support
                     if (this.onPrePointerObservable.hasObservers()) {
                         if (!clickInfo.ignore) {
@@ -2030,8 +2032,6 @@ module BABYLON {
                         return;
                     }
 
-                    this._pointerCaptures[evt.pointerId] = false;
-
                     if (!this.pointerUpPredicate) {
                         this.pointerUpPredicate = (mesh: AbstractMesh): boolean => {
                             return mesh.isPickable && mesh.isVisible && mesh.isReady() && mesh.isEnabled();