You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if anyone has a good solution for retaining the correct caret position when the html being rendered is being changed dynamically (such as adding classes to certain elements or bolding/italicizing certain letters as the user types).
Here is the example codesandbox showing how the current library fails to retain the correct caret position as the incoming html changes:
In this example I'm modifying the class="yay" to add a 1 in front of it each time something changes. This causes the caret to jump to the end of the text.
Thanks for the help!
The text was updated successfully, but these errors were encountered:
Hey there,
I'm wondering if anyone has a good solution for retaining the correct caret position when the html being rendered is being changed dynamically (such as adding classes to certain elements or bolding/italicizing certain letters as the user types).
Here is the example codesandbox showing how the current library fails to retain the correct caret position as the incoming html changes:
https://codesandbox.io/s/simple-rich-text-editor-in-react-forked-q83ue?file=/src/index.js
In this example I'm modifying the class="yay" to add a
1
in front of it each time something changes. This causes the caret to jump to the end of the text.Thanks for the help!
The text was updated successfully, but these errors were encountered: