Allow input to be updated with onInputChange#907
Merged
JedWatson merged 2 commits intoJedWatson:masterfrom Apr 26, 2016
brettdewoody:feature/update-on-oninputchange
Merged
Allow input to be updated with onInputChange#907JedWatson merged 2 commits intoJedWatson:masterfrom brettdewoody:feature/update-on-oninputchange
JedWatson merged 2 commits intoJedWatson:masterfrom
brettdewoody:feature/update-on-oninputchange
Conversation
Collaborator
|
@brettdewoody see bruderstein@f964825 for my suggestion :) |
Contributor
Author
|
As expected, much better. Should I close this PR in favor of bruderstein@f964825? |
Collaborator
|
No, just grab my commit if you like it, and add it to your branch - it's On Thu, 21 Apr 2016, 08:35 Brett DeWoody, notifications@github.com wrote:
|
onInputChange is now called from `handleInputChange`, which is less surprising than `componentDidUpdate`, and should stop the double render, and hence the flash of typed content, as opposed to what is returned from `onInputChange`. Simplified the tests by using the existing `createComponentWithWrapper` function, and using a stub. This should make the tests clearer. Added a couple of tests for returning different things (e.g. null, numbers), and one to check the new value is actually rendered in the DOM.
Owner
|
Thanks @brettdewoody! Looks great. |
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.
Allows the input to be modified by returning a value from
onInputChange.Refs #893.