Expose select to async creatable#1360
Closed
DanielHeath wants to merge 4 commits intoJedWatson:masterfrom
Closed
Conversation
This abstraction might be justified if there were 3+ copies of the loop, but for a single item it's added overhead + confusion to no benefit.
Previously, if you provided an `onInputChange` prop to a `Creatable` it would be silently discarded. After this change you can use Creatable and also get an event when the user types input.
When deleting a multi select item, the input is cleared but no change event is fired for the input box. This patch detects changes to the options list and updates `Creatable`'s cache of the input value.
This enables users of AsyncCreatable to hook the Select which is created and/or access it as a ref. Previously there was no way to get at the underlying Select if you used AsyncCreatable.
2d3c063 to
1ddb8d9
Compare
Collaborator
|
thanks for this @DanielHeath I've taken out the main chunk of this PR and ported it over to this one #2084 the other fixes you've made have already been resolved in master. |
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.
Both
AsyncandCreatablekeep a reference to the underlyingSelect(which can be accessed by consumers), butAsyncCreatabledoes not.This patch unifies this behavior.