jarek-foksa / xel

Xel - Widget toolkit for building native-like Electron and Web apps
https://xel-toolkit.org
Other
696 stars 61 forks source link

Jump to the end of text in x-texteditor programmatically is not possible #147

Closed bweinlich closed 3 months ago

bweinlich commented 3 months ago

I defined a x-texteditor like this:

<x-texteditor id="prompt-text-editor">

Now I programmatically add some text inside the text area and set the focus to it:

document.getElementById("generated-text-editor").value = text;
document.getElementById("generated-text-editor").focus();

Expected behaviour: The text cursor is at the end of the text.

Actual behaviour: The text cursor is at the beginning of the text.

Unfortunately I haven't found a workaround yet. The

element is inside a closed shadow dom and therefore can't be accessed.

Could you fix this or give me a hint for a workaround please?

bweinlich-wps commented 3 months ago

Thank you!