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

Prevent isFetching bug in useSelect #1450

Closed
wants to merge 1 commit into from

Conversation

haydenlinder
Copy link

Related to #1448

Description

When using searchable select with loadoOptions, the spinner persists after the promises have resolved.

The cause was this line returning true because there was an extra compareValues function in the reducer payloads.

I saved that function to another variable and removed it from the payload.

Schema (if applicable)

     {
              component: 'select',
              label: 'Select',
              name: 'select',
              options: [],
              isSearchable: true,
              loadOptions: () =>
                new Promise((res) =>
                  setTimeout(
                    () =>
                      res([
                        { value: 'first-option', label: 'First async option' },
                        { value: 'second-option', label: 'Second async option' },
                      ]),
                    2500
                  )
                ),
            },

Checklist: (please see documentation page for more information)

  • [ x] Yarn build passes
  • [ x] Yarn lint passes
  • [ x] Yarn test passes
  • Test coverage for new code (if applicable)
  • Documentation update (if applicable)
  • Correct commit message
    • format fix|feat({scope}): {description}
    • i.e. fix(pf3): wizard correctly handles next button
    • fix will release a new _._.X version
    • feat will release a new _.X._ version (use when you introduce new features)
      • we want to avoid any breaking changes, please contact us, if there is no way how to avoid them
    • scope: package
    • if you update the documentation or tests, do not use this format
      • i.e. Fix button on documenation example page

Copy link

vercel bot commented Mar 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
react-forms ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 21, 2024 8:54am

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 94.48%. Comparing base (271e466) to head (8edbfea).

Files Patch % Lines
packages/common/src/use-select/reducer.js 66.66% 2 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1450   +/-   ##
=======================================
  Coverage   94.48%   94.48%           
=======================================
  Files         210      210           
  Lines        3971     3973    +2     
  Branches     1628     1628           
=======================================
+ Hits         3752     3754    +2     
  Misses        219      219           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@haydenlinder
Copy link
Author

Closing in favor of #1449

@Hyperkid123
Copy link
Member

Closing in favor of #1449

Ah. I see you found part of the problem as well. :)

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.

None yet

2 participants