Demo Playground
(Try to write something in the demo and see this unwanted behaviour)
A div
content can be changed when user is typing in it, and the text is evaluated and some words get marked (wrapper element), so the HTML of the div
is changed and user is loosing the caret position.
I can know what the caret offset was just before the HTML change, but I don't know how to restore the caret to that place, once the HTML has changed, the Range object means nothing...
Thanks for any help!