Guide пре 6 година
родитељ
комит
a02e688976
1 измењених фајлова са 1 додато и 1 уклоњено
  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--;