SelectInput: explicitly declare props #119
Merged
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.
Summary
SelectInput
(drops support for currently unused props)SelectInput
out of beta statusDetails
So far we've been lax on the props we accept for
SelectInput
. We forwarded all props toreact-select
and just excluded the ones intended forSelectInput
itself.This has been good in the beginning when the usage of
SelectInput
was still unclear. Now that things have become more concrete, it's time to be stricter on the API.This PR removes the generic pass-through of props and instead only forwards supported props. It also updates the documentation to mention all supported properties instead of referring to the
react-select
documentation.In theory we should be able to replace
react-select
with any other implementation without having to touch the consumers. It is thus good to be explicit on the supported properties. This also makes it easier for consumers to see what we're supporting officially.We can extend what
SelectInput
forwards toreact-select
in case any consumer ever needs to use a property supported byreact-select
but not currently forwarded bySelectInput
.Fix
The selected values had been shown in the order they appear in the
options
instead of the order they were selected in. This is quite confusing when using the component and so I changed it. They are now shown in the order they were selected in.Note
This is a breaking change, but it should not affect the MC apps. I looked through the usages and the removed props were not used by any of our apps.