FormidableLabs / freactal

Clean and robust state management for React and React-like libs.
MIT License
1.65k stars 47 forks source link

Jumping cursor with controlled input #111

Open jakubito opened 5 years ago

jakubito commented 5 years ago

Create controlled input with freactal store - whenever you type a character at any cursor position, the cursor jumps to the end of input. This repro is taken straight from the README https://github.com/FormidableLabs/freactal#effects https://codesandbox.io/s/4xoo5k50l7

bingomanatee commented 5 years ago

I have found this to be true. Its something to do with order of operations/race conditions. I know this doesn't sound like a solution but I would suggest that you use component state for inputs and relay that state to Freactal indirectly in the componentDidUpdate hook.