react-contenteditable
react-contenteditable copied to clipboard
Passing a new className prop will move the caret position to the end of the element
Current behavior
When the html prop is not updated, but the className
prop is, then the caret position will move to the end of the element.
Desired behavior
Changing a className
should leave the caret position as it is.
I was able to fix this by removing the following line (not too sure of the consequences of this but its working fine for me) https://github.com/lovasoa/react-contenteditable/blob/f4d81dd974c26f23b432f16d2521362c8e6cfb2e/src/react-contenteditable.tsx#L93
I forked the repo and did the same thing! But I wasn't sure of the consequences either...
Thanks for helping out!