react-medium-editor
react-medium-editor copied to clipboard
Cursor jumping issues with medium-editor 5.21.1
I had issues where typing at the end of a line would lead to a jump of the cursor position to the beginning of the next paragraph using the latest version 5.21.1
of medium-editor.
I tried downgrading react to match the version used in the example with no luck.
Once I downgraded medium-deitor to 5.10.0
as in the example the issue went away.
Could this be the same issue as discussed here? https://github.com/facebook/react/issues/2047
Might https://github.com/wangzuo/react-medium-editor/pull/19 be related?
Maybe. I stopped using react-medium-editor because of this and issues with undo. Now using the editor outside of my react root.
As this is almost a year old: are there any news on this?
As this is almost 2 years old its there an update on this?
You can prevent this, but you need to use shouldComponentUpdate to prevent re-rendering when content isn't changed. Most basic / stupid approach would be :
shouldComponentUpdate(nextProps, nextState) {
if (JSON.stringify(this.props) === JSON.stringify(nextProps) && this.state === nextState)
return false
return true
}