Fix behavior of ReactDOMSelect with defaultValue#251
Merged
yungsters merged 1 commit intofacebook:masterfrom Aug 18, 2013
Merged
Fix behavior of ReactDOMSelect with defaultValue#251yungsters merged 1 commit intofacebook:masterfrom
defaultValue#251yungsters merged 1 commit intofacebook:masterfrom
Conversation
Member
|
You don't by chance want to write tests for this do you? I know we don't have much coverage for our form components... |
Collaborator
Author
|
Sure, I can. |
Collaborator
Author
|
@zpao Tests added! Hard to simulate user interaction but I am testing what was broken. |
Member
There was a problem hiding this comment.
Not a huge deal, but formatting nit - move <select ...> to new line, indented. There are a few instances of this.
Collaborator
Author
There was a problem hiding this comment.
Done, sorry. Still haven't figured out exactly what your indentation rules are. :)
Contributor
|
By the way, thanks for fixing this and writing unit tests. Sorry for the delay in review. |
Closes facebook#250. Test Plan: With multiple and not, verified: With defaultValue, the correct option is picked initially, user changes change the selection, and changes to defaultValue have no effect. With value, the correct option is picked initially, user changes do nothing, and changes to value change the selection. Also ran the tests.
Collaborator
Author
|
@yungsters okay, added back the multiple handling, added tests for it, and inlined getValue. Let me know if there's anything else. |
Contributor
|
Awesome, this looks great. Thanks! |
yungsters
added a commit
that referenced
this pull request
Aug 18, 2013
Fix behavior of ReactDOMSelect with `defaultValue`
bvaughn
pushed a commit
to bvaughn/react
that referenced
this pull request
Aug 13, 2019
Use WebpackDevServer for local testing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #250.
Test Plan:
With
multipleand not, verified: WithdefaultValue, the correct option is picked initially, user changes change the selection, and changes todefaultValuehave no effect. Withvalue, the correct option is picked initially, user changes do nothing, and changes tovaluechange the selection.cc @yungsters