How do I get the current cursor position? #2160
Unanswered
randomsmith9
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have been playing about with the mention atom inside the editor and got that working nicely.
I also wanted to be able to programmatically create atoms and I see one way to do this is using the createMentionAtom but this requires a range so I wanted to know how to get the current cursor position.
What partially works for me so far is a button, but I cannot work out from the documentation or codebase on how to get the current cursor position.
I was also wanting to have a button that could in effect open the mention atom menu and allow it to be clicked then put the mention at the current cursor location, but not figured out if that is possible. The kind of thing I was trying to achieve with this is a bit like placeholder variables where a user could dropdown the menu to insert a mention kind of like
Dear
and then I can use the json tree to get the editor content and convert that to a piece of text for use elsewhere and while doing that I can replace the mentions with the real values.
Beta Was this translation helpful? Give feedback.
All reactions