Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cursor jumps to the end when editing in the middle #3

Open
kevinresol opened this issue Aug 28, 2019 · 3 comments
Open

Cursor jumps to the end when editing in the middle #3

kevinresol opened this issue Aug 28, 2019 · 3 comments

Comments

@kevinresol
Copy link
Member

kevinresol commented Aug 28, 2019

@:state title:String = '';
function render() '<input onchange=${e -> title = e.src.value}/>';

react

ref:facebook/react#955 (comment)

Seems that setState has to be called in the onchange event handler to prevent that.
I guess coconut does an async render so that is not the case...

@kevinresol
Copy link
Member Author

Current workaround is to force a sync render right inside the onchange callback, by running Renderer.updateAll()

@back2dos
Copy link
Member

Hmm, alternatively forceUpdate in the view itself might also work - depending on react version.

@kevinresol
Copy link
Member Author

Hmm, alternatively forceUpdate in the view itself might also work - depending on react version.

Seems not working. I guess because coconutRender hasn't yet run to update the vdom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants