Przeglądaj źródła

Correct DEL overrun

Guide 6 lat temu
rodzic
commit
a02e688976
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      gui/src/2D/controls/inputText.ts

+ 1 - 1
gui/src/2D/controls/inputText.ts

@@ -307,7 +307,7 @@ export class InputText extends Control implements IFocusableControl {
                 }
                 return;
             case 46: // DELETE
-                if (this._text && this._text.length > 0) {
+                if (this._text && this._text.length > 0  && this._cursorOffset > 0) {
                     let deletePosition = this._text.length - this._cursorOffset;
                     this.text = this._text.slice(0, deletePosition) + this._text.slice(deletePosition + 1);
                     this._cursorOffset--;