Search code examples
tinymceonfocus

How to return range or location of cursor in TinyMCE when clicked or cursor location changed?


how can I get the location of the cursor when the TinyMCE editor is focused on or when cursor location changes?

Thanks.


Solution

  • Use the tinymce onActivate event in case of focus. A cursor location change is possible, but it is expensive to detect, because you will have to check on each key-action if the cursor is still on the previous spot or not.