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 @@ + + + + + + + TextArea + + + + + + + + + + + + + + + + + +
+ Simple TextArea + +
+ This msg will not be displayed as no value-state is set. +
+
+ + + list item + list item + list item + list item + + +
+ +
+ + + + +
+
+ + + + diff --git a/packages/main/test/pages/Selection.html b/packages/main/test/pages/Selection.html new file mode 100644 index 000000000000..ae7bd581468c --- /dev/null +++ b/packages/main/test/pages/Selection.html @@ -0,0 +1,183 @@ + + + + + + + TextArea + + + + + + + + + + + + + + + + + +
+ Simple TextArea + +
+ This msg will not be displayed as no value-state is set. +
+
+ + + alabala + alabala + alabala + alabala + + +
+ +
+ + + + +
+
+ + + + diff --git a/packages/main/test/pages/TextArea.html b/packages/main/test/pages/TextArea.html index e35fdb4e42ac..54b8be376542 100644 --- a/packages/main/test/pages/TextArea.html +++ b/packages/main/test/pages/TextArea.html @@ -200,7 +200,10 @@ This should not be in aria-label property of the text area - + + + +