diff --git a/packages/dev/gui/src/2D/controls/inputText.ts b/packages/dev/gui/src/2D/controls/inputText.ts index 34201249599..a29ccecc72f 100644 --- a/packages/dev/gui/src/2D/controls/inputText.ts +++ b/packages/dev/gui/src/2D/controls/inputText.ts @@ -476,7 +476,7 @@ export class InputText extends Control { } if (this._onFocusSelectAll) { - this._selectAllText(); + this.selectAllText(); } } @@ -510,7 +510,7 @@ export class InputText extends Control { //select all if (evt && (evt.ctrlKey || evt.metaKey) && keyCode === 65) { - this._selectAllText(); + this.selectAllText(); evt.preventDefault(); return; } @@ -800,8 +800,11 @@ export class InputText extends Control { this._cursorIndex = -1; this._markAsDirty(); } - /** @internal */ - protected _selectAllText() { + + /** + * Allow the user to select all text + */ + public selectAllText() { this._blinkIsEven = true; this.isTextHighlightOn = true; diff --git a/packages/dev/gui/src/2D/controls/inputTextArea.ts b/packages/dev/gui/src/2D/controls/inputTextArea.ts index f3c8299637e..af6b5be5a2d 100644 --- a/packages/dev/gui/src/2D/controls/inputTextArea.ts +++ b/packages/dev/gui/src/2D/controls/inputTextArea.ts @@ -472,7 +472,7 @@ export class InputTextArea extends InputText { // special case - select all. Use key instead of code to support all keyboard layouts if (key === "a" && evt && (evt.ctrlKey || evt.metaKey)) { - this._selectAllText(); + this.selectAllText(); evt.preventDefault(); return; } @@ -1189,7 +1189,7 @@ export class InputTextArea extends InputText { } /** @internal */ - protected override _selectAllText() { + public override selectAllText() { this._isTextHighlightOn = true; this._blinkIsEven = true;