Просмотр исходного кода

Fixed prompt error when cancel was selected

David Catuhe 8 лет назад
Родитель
Сommit
5e136bbc4c
1 измененных файлов с 5 добавлено и 1 удалено
  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;
             }