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

Set value using attribute only on initial option render #6449

Merged
merged 1 commit into from Apr 8, 2016

Conversation

Projects
None yet
5 participants
@sophiebits
Copy link
Collaborator

commented Apr 8, 2016

Tested that you can now type in the middle of a controlled input in Chrome which previously jumped your cursor to the end.

Fixes #6445.

Set value using attribute only on initial option render
Tested that you can now type in the middle of a controlled input in Chrome which previously jumped your cursor to the end.

Fixes #6445.
@sebmarkbage

This comment has been minimized.

Copy link
Member

commented Apr 8, 2016

How sure are you on this fixing the original issue? What's the summary of why this works?

@sophiebits

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 8, 2016

This basically reverts #6228. That broke cursor positioning because setting .value on an input (in contrast to other tags like option) doesn't make .hasAttribute('value') true. Then we just need to make <option value=""> properly create an option with an empty value attribute, which I did by setting it manually after creation for options only. This does not work properly for <option> transitioning to <option value=""> but neither did 0.14.

@jimfb

This comment has been minimized.

Copy link
Contributor

commented Apr 8, 2016

I did not like that other fix, I felt like it was janky and was going to lead to edge cases that would bite us. I similarly don't like this one. I'd feel much more comfortable if we went with #6406. We still could; it is rebased and ready-to-go.

Anyway, accepting to unblock ( 👍 )

@sophiebits sophiebits merged commit 2b1bd1d into facebook:master Apr 8, 2016

1 check was pending

continuous-integration/travis-ci/pr The Travis CI build is in progress
Details

zpao added a commit to zpao/react that referenced this pull request Apr 8, 2016

Merge pull request facebook#6449 from spicyj/option-value
Set value using attribute only on initial option render
(cherry picked from commit 2b1bd1d)

@zpao zpao added the semver-patch label Apr 22, 2016

@zpao zpao added this to the 15.0.1 milestone May 17, 2016

@renovate renovate bot referenced this pull request Feb 2, 2018

Open

Update dependency react to v0.14.9 #29

0 of 1 task complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.