tbleckert / react-select-search

⚡️ Lightweight select component for React
https://react-select-search.com
MIT License
676 stars 149 forks source link

Issue #140, part 2 - Fix issue where input would error out if selected value went missing #157

Open joeyparis opened 3 years ago

joeyparis commented 3 years ago

This is a very similar issue to #140 (fixed by #141), but later in the life cycle.

Scenario:

  1. Array of selected values already available
  2. Actual options are still waiting for an API call (#141 fixed this leading to the code breaking)
  3. Initial API results are displayed with the now available matched values
  4. A new API request is made via search, and the previously matched values are missing (This pull request fixes the code breaking)
  5. Previously matched values are returned and once again marked as selected

As @tbleckert mentioned here, this is more of a patch than it is an actual fix. But still probably worth merging in for the time being, and then keeping in mind for the real solution with getOption when used with getDisplayValue and isSelected.

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tbleckert/react-select-search/BEzzoagNSuJG8Zciko3rQmhnnEWX
✅ Preview: https://react-select-search-git-fork-joeyparis-fix-iss-09f7b5-tbleckert.vercel.app