diff --git a/packages/main/src/TextArea.ts b/packages/main/src/TextArea.ts index 5e5631dbb386..fdb2e28c5c53 100644 --- a/packages/main/src/TextArea.ts +++ b/packages/main/src/TextArea.ts @@ -452,6 +452,22 @@ class TextArea extends UI5Element implements IFormElement { this.previousValue = this.getInputDomRef().value; } + get selectionStart() { + return this.shadowRoot!.querySelector("textarea")!.selectionStart; + } + + set selectionStart(sel) { + this.shadowRoot!.querySelector("textarea")!.selectionStart = sel; + } + + get selectionEnd() { + return this.shadowRoot!.querySelector("textarea")!.selectionEnd; + } + + set selectionEnd(sel) { + this.shadowRoot!.querySelector("textarea")!.selectionEnd = sel; + } + _onfocusout(e: FocusEvent) { const eTarget = e.relatedTarget as HTMLElement; const focusedOutToValueStateMessage = eTarget?.shadowRoot?.querySelector(".ui5-valuestatemessage-root"); diff --git a/packages/main/test/pages/Selection-patched.html b/packages/main/test/pages/Selection-patched.html new file mode 100644 index 000000000000..07a068f783e0 --- /dev/null +++ b/packages/main/test/pages/Selection-patched.html @@ -0,0 +1,209 @@ + + + +
+ + +