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

Expose select to async creatable #1360

Conversation

DanielHeath
Copy link
Contributor

Both Async and Creatable keep a reference to the underlying Select (which can be accessed by consumers), but AsyncCreatable does not.

This patch unifies this behavior.

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.
@DanielHeath DanielHeath force-pushed the expose-select-to-async-creatable branch from 2d3c063 to 1ddb8d9 Compare November 14, 2016 01:02
@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 92.494% when pulling 1ddb8d9 on DanielHeath:expose-select-to-async-creatable into ad337ee on JedWatson:master.

@gwyneplaine
Copy link
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants