Open xzilja opened 8 years ago
Not quite sure how redux works with this, maybe more code sample would help.
@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.
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.