0

How do I get the current cursor position in a lightning:inputrichtext field?

Say an event is triggered and I want to insert text at the cursor. What does the js look like?

  • 1
    Can you please show the code, what you have tried so far. – Arpit Sethi Jul 29 '17 at 11:16
1

I believe it is not possible because you need to get hold of the cursor position of the lightning:inputRichText which is not exposed either by attribute or by action as of now, also it's part of lightning namespace so you cannot read the DOM due to Locker Service.

If you are using HTML textarea tag (need to manually do the data binding stuffs), then you achieve the behavior as explained in this SO thread

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.