evancz / elm-todomvc

The TodoMVC app written in Elm, nice example for beginners.
http://evancz.github.io/elm-todomvc/
BSD 3-Clause "New" or "Revised" License
1.22k stars 329 forks source link

After inserting/deleting a character in the textbox, the caret will move to the end of the text. #4

Closed halohalospecial closed 10 years ago

Raynos commented 10 years ago

This is what the soft set hook is for.

Raynos commented 10 years ago

You need to implement something like https://github.com/Raynos/virtual-hyperscript/blob/master/index.js#L54-L61 in elm-html to work around this bug.

A check before set is needed for input text to avoid mutating the position of the cursor / caret.

halohalospecial commented 10 years ago

Thanks Raynos :)