Giving internal state 'dateString' first priority for input value.#1287
Merged
majapw merged 1 commit intoreact-dates:masterfrom Aug 10, 2018
Merged
Giving internal state 'dateString' first priority for input value.#1287majapw merged 1 commit intoreact-dates:masterfrom
majapw merged 1 commit intoreact-dates:masterfrom
Conversation
ljharb
requested changes
Jul 25, 2018
Member
ljharb
left a comment
There was a problem hiding this comment.
This seems like a simple solution, which is great! Can we add a regression test for this?
Author
|
Test has been added that ensures the prop will take precedence over the state when passed in. Within the same file, tests on lines 19, 25, and 102 do a great job of covering scenarios as well. |
ljharb
approved these changes
Aug 10, 2018
majapw
approved these changes
Aug 10, 2018
Collaborator
majapw
left a comment
There was a problem hiding this comment.
This seems great and simple to me! :)
|
This fix is awseome. Any idea when is a new version of react-dates going to be pushed to npm with this fix? |
Collaborator
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.
Resolve #1013
It's an issue with react when replacing the entire string value vs internal managed state.
This change will use dateString when the user is typing within the input field and switch over to displayValue when a date is selected via the calendar.