Skip to content
This repository was archived by the owner on May 2, 2024. It is now read-only.

Proposal: Replace input's value for defaultValue #39

Closed
wants to merge 1 commit into from
Closed

Proposal: Replace input's value for defaultValue #39

wants to merge 1 commit into from

Conversation

pablohirafuji
Copy link
Contributor

Problem

If you type too fast in an input or text area, the cursor will jump to the end and make typos, as seen here.

Solution

As suggested by Kris and Richard, here and here, make use of the defaultValue attribute instead value solves the problem and, so far I tested, has no side effects (we still get the input event and can alter the input visual text programatically).

# Problem

If you type too fast in an input or text area, the cursor will jump to the end and make typos, as seen [here](evancz/elm-html#81 (comment)).

# Solution

As suggested by Kris and Richard, [here](evancz/elm-html#81 (comment)) and [here](https://gist.github.com/rtfeldman/5f015adbdfbba541c7e7e1409b6efeef#gistcomment-1831492), make use of the [defaultValue](http://package.elm-lang.org/packages/elm-lang/html/1.1.0/Html-Attributes#defaultValue) attribute instead value solves the problem and, so far I tested, has no side effects (we still get the input event and can alter the input visual text programatically).
@pablohirafuji
Copy link
Contributor Author

pablohirafuji commented Jul 27, 2016

Sorry, I was wrong. This reintroduce this (If the user edit the textarea once, any further javascript update is not computed) bug.

I don't know how to fix both :(

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

Successfully merging this pull request may close these issues.

1 participant