ui5-webcomponents icon indicating copy to clipboard operation
ui5-webcomponents copied to clipboard

[Feature Request]: TextArea - Provide selectionStart and SelectionEnd

Open pop1989bb opened this issue 9 months ago • 7 comments

Feature Request Description

For some cases it would be great to have the selectionStart and selectionEnd attributes from the native html textarea component.

Proposed Solution

Provide the access to the native attributes selectionStart and selectionEnd.

Proposed Alternatives

No response

Organization

No response

Additional Context

No response

Priority

None

Privacy Policy

  • [X] I’m not disclosing any internal or sensitive information.

pop1989bb avatar May 02 '24 10:05 pop1989bb

Hi colleagues, can you, please, review this enhancement request regarding ui5-textarea? Thank you! Best regards, Petya Markova. (UI5 Dispatcher)

PetyaMarkovaBogdanova avatar May 02 '24 11:05 PetyaMarkovaBogdanova

Hi,

I had the same requirement for plain input fields: see #4620

The proposed workaround was along these lines: e.currentTarget.shadowRoot.querySelector("input").selectionStart

texttechne avatar May 02 '24 14:05 texttechne

ok. Then lets hope that they will implement it in future.

pop1989bb avatar May 03 '24 09:05 pop1989bb

@pop1989bb ,

Is the requirement regarding the TextArea or the Input field? I am asking as we have the selection event exposed in the TextArea and we can provide a util code, which will provide the coordinates of the selection start / end.

If you need it in the input component, we are still to introduce it there.

hristop avatar May 08 '24 06:05 hristop

@hristop For the textArea. This would be great! For the Input component it could be interesting for @texttechne

Kind regards

pop1989bb avatar May 08 '24 07:05 pop1989bb

@hristop, yeah I would love to have the very same API for the input field as well. Also would stress the point of consistency. I tried to make my point for the input field in #4620. selectionStart and selectionEnd are needed to realize stuff like an Input Mask component, for example...

texttechne avatar May 17 '24 13:05 texttechne

Hi @pop1989bb ,

Sorry for the delay here. Here is the mentioned util for the text area: https://stackblitz.com/edit/js-r5m2rz?file=package.json,util.js,index.js

Best Regards, Hristo

hristop avatar Jul 03 '24 12:07 hristop

Relates to: #8336 #7830

hristop avatar Jul 17 '24 12:07 hristop

@hristop Thank you for the example!

pop1989bb avatar Jul 17 '24 15:07 pop1989bb

Hi @pop1989bb ,

I would consider this issue done. If you don't think so, please post a comment with description to why this is not the case and we will reopen it.

Best Regards, Hristo

hristop avatar Aug 02 '24 05:08 hristop