react-medium-editor icon indicating copy to clipboard operation
react-medium-editor copied to clipboard

Serving text from redux state causes it to be typed vice versa

Open xzilja opened this issue 9 years ago • 2 comments

I am updating text in my redux state onChange within an editor, due to this editors text is now set from redux state, every time it changes the typing cursor jumps to the beginning resulting in text that is typed vice versa.

This is my related stackoverflow post.

xzilja avatar Feb 25 '16 09:02 xzilja

Not quite sure how redux works with this, maybe more code sample would help.

wangzuo avatar Feb 25 '16 09:02 wangzuo

@wangzuo Well, essentially with redux I want to preserver state onChange of the <Editor> component. to do so I call a function that onChange pases current text of the editor to redux state, once redux state it updated it also updates state of editor component as well with contents from redux, such state is used liketext=this.state.text in the editor. Component re renders on change, this causes that blinking line cursor that is usually at the end of the text, jump to the beginning of the text (so think of prepending text) where it should ideally append any new changes.

xzilja avatar Feb 25 '16 09:02 xzilja