I have already asked another question: How to set caret position in a contenteditable after I append a span into it; and move caret to the end of the span?
My code adds the span tag and then modifies the innerHTML of the content editable element like;
contenteditable.innerHTML = newModifiedDataWithSpan;
but this causes my contenteditable to lose focus. If I use focus() on the element, the caret moves to the beginning of the contenteditable. Is there anyway to append a unicode character to the end my inputted span, and then search for said character, remove it and move caret to that position?