Browse Source

Fixed prompt error when cancel was selected

David Catuhe 7 years ago
parent
commit
5e136bbc4c
1 changed files with 5 additions and 1 deletions
  1. 5 1
      gui/src/controls/inputText.ts

+ 5 - 1
gui/src/controls/inputText.ts

@@ -168,7 +168,11 @@ module BABYLON.GUI {
             this.onFocusObservable.notifyObservers(this);
 
             if (navigator.userAgent.indexOf("Mobile") !== -1) {
-                this.text = prompt(this.promptMessage);
+                let value = prompt(this.promptMessage);
+
+                if (value !== null) {
+                    this.text = value;
+                }
                 this._host.focusedControl = null;
                 return;
             }