Skip to content

Drag and Drop in TextArea #5754

Closed Answered by Lukas742
pop1989bb asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @pop1989bb

inserting a text at the current cursor position via drag and drop is not easily achievable. Most probably you'll need some calculations based on cursor position, fontSize, lineHeight, etc. The same goes for native textarea elements.

The ui5-textarea component doesn't expose the selectionStart property, so if you feel like this should be possible, please open a feature request in the ui5-webcomponents repo, since the component is developed there.

Since the ui5-textarea uses a textarea internally, it's still possible to read the selectionStart property, although you'll have to access theshadowRoot for this. I've created an example of an implementation that inserts the text at …

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by pop1989bb
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants