I’ve been trying to insert text at the location of the cursor in the rich text editor. I came across this post where @dorilama was able to do it using some ustom code, but did not go into detail about how he acheived this. I followed the general guide he posted about “pars[ing] the elements, calculat[ing] the position, chang[ing] the html of the elements and set[ing] back the caret position.” I was able to get all that functioning on a button click, but would love to do it using mentions like he did in the gif.
I also looked at using a keydown event listener that waits for the @ symbol to be typed, but I don’t want to build a custom component. I also tried an on change event, but the event.value of the rich text returns the entirety of the rich text html, not just the most recent key pressed.
At this point, I just need a solution that allows me to insert custom text into the rich text editor at the location of the cursor, and allows the user to change this text after it is inserted. Any and all suggestions would be greatly appreciated.