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?
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It only takes a minute to sign up.Sign up to join this community
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