Hi Guys,
I have a HTMLEditor and a button in a component, when I click the button I want to add some text to the editor content at the current position of the cursor. Is this possible?
Thanks in advance, Andy.
Hi Guys,
I have a HTMLEditor and a button in a component, when I click the button I want to add some text to the editor content at the current position of the cursor. Is this possible?
Thanks in advance, Andy.
Hi Enchev,
This works well thanks, but there's an issue with it. It will get add the text into any text field you have focus on, so if I have a text field and the HTML editor and I'm focussed in the text field it will add the text there.
Thanks, Andy.
You can extend the code as per your needs similar to my example in the thread you've posted and later deleted your comment.
Hi Enchev,
I've tried to implement your code using myField.selectionStart but this always returns undefined for the html editor. It works great on a normal text area but the editor isn't a text input field I believe?
Thanks, Andy.