-
Notifications
You must be signed in to change notification settings - Fork 136
Closed
Description
We started using react-select library a pretty long time ago. And current version 0.9.1 has several issues while the latest version is 2.4.0.
Issues:
- Warning in browser console:
Warning: Unknown prop 'minWidth' on <input> tag. - Warning in browser console:
Warning: AutosizeInput: isMounted is deprecated. - So far we have to call API method directly from the component because the current version expects a promise as
asyncOptions. And if we try to rewrite it in a controlled way to utilize the Redux actions and reducers we have to defineonInputChangeto react on input change. But if we define it, then current version doesn't update the input value and we cannot control input value from the outside. So we cannot implement it in a controlled way.
At the moment we use react-select only in two places:
- File permissions dialog by utilizing
UserAutoCompletecomponent https://github.com/appirio-tech/connect-app/blob/feature/team-management-autocomplete/src/components/UserAutoComplete/UserAutoComplete.jsx#L14 - Topcoder/Prokect team dialogs by utilizing
AutocompleteInputcomponent https://github.com/appirio-tech/connect-app/blob/feature/team-management-autocomplete/src/components/TeamManagement/AutocompleteInput.jsx#L12
TODO
- Update
react-selectto the latest2.4.0version. - Refactor
AutocompleteInput- Split
AutocompleteInputcomponent into two:AutocompleteInputandAutocompleteInputContainer. Only container should be connected to the redux store. - It shouldn't call API method
loadMemberSuggestionsdirectly, but call a redux actionloadMemberSuggestionsinstead from https://github.com/appirio-tech/connect-app/blob/feature/team-management-autocomplete/src/projects/actions/projectMember.js#L24 - Update code of
LOAD_MEMBER_SUGGESTIONSreducer. Now it keeps values for suggested member in the same place where we keep all the members:members.members. We don't want them mix them up. So we should keep suggested members inmembers.suggestedMembersinstead https://github.com/appirio-tech/connect-app/blob/feature/team-management-autocomplete/src/reducers/members.js#L18. Also, now we keep suggested members as an object which doesn't guaranties an order. So we should keep the suggested members as an array instead. - After we updated reducer
AutocompleteInputContainercan get list of suggested members from the Redux storemembers.suggestedMembersand pass it toAutocompleteInputto show them.
- Split
UserAutoCompleteshould still work afterreact-selectversion update.