Skip to content

Commit

Permalink
Fix #15790 (#15797)
Browse files Browse the repository at this point in the history
  • Loading branch information
deltakosh authored Nov 8, 2024
1 parent fa3f8da commit ae594bf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions packages/dev/gui/src/2D/controls/inputText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,7 @@ export class InputText extends Control {
}

if (this._onFocusSelectAll) {
this._selectAllText();
this.selectAllText();
}
}

Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions packages/dev/gui/src/2D/controls/inputTextArea.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -1189,7 +1189,7 @@ export class InputTextArea extends InputText {
}

/** @internal */
protected override _selectAllText() {
public override selectAllText() {
this._isTextHighlightOn = true;
this._blinkIsEven = true;

Expand Down

0 comments on commit ae594bf

Please sign in to comment.