backbone-react-component icon indicating copy to clipboard operation
backbone-react-component copied to clipboard

Typing in input field makes cursor jump to the end of input

Open markmiro opened this issue 10 years ago • 2 comments

Maybe I'm doing it wrong, but here's an example of the bug: http://codepen.io/markmiro/pen/pjbVma?editors=001

Is there another way to get the Backbone model and React view to stay in sync? I would like to sync the two to do things like live input validation.

Thanks!

markmiro avatar Sep 22 '15 00:09 markmiro

That would be awesome! But for now, the only working "solution" I got is duplicating the model attribute into the view state (on componentWillMount for example) then bind input onChange to setState with input value. And finally on a submit or whatever, set the model attribute with the view state... :disappointed:

heymath avatar Nov 16 '15 17:11 heymath

Well you can also rely on an onBlur event instead of onChange, though that's not neat.

magalhas avatar Nov 16 '15 17:11 magalhas