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

Allow user to provide a custom loading indicator #414

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MartaGlanc
Copy link

This PR adds a loader prop to MentionsInput component. This allows the user to provide their own React element to use as a loading indicator.

I initially wrote this as a patch for one of my projects at work, where the design required me to use Material UI's CircularProgress component for all loaders.

Also added a demo and documented the isLoading prop on Mention.

@vercel
Copy link

vercel bot commented Jul 5, 2020

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/signavio/react-mentions/mll3l1eki
✅ Preview: https://react-mentions-git-fork-martaglanc-feature-custom-loader-a9ede6.signavio.vercel.app

@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2020

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 78.87%. Comparing base (ad1a281) to head (26f6f3c).
Report is 101 commits behind head on master.

Files with missing lines Patch % Lines
src/SuggestionsOverlay.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master     #414   +/-   ##
=======================================
  Coverage   78.87%   78.87%           
=======================================
  Files          31       31           
  Lines         691      691           
  Branches      107      107           
=======================================
  Hits          545      545           
  Misses        145      145           
  Partials        1        1           

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

@atilafassina atilafassina force-pushed the master branch 2 times, most recently from 8265bf0 to 8dedc5d Compare May 27, 2022 06:16
@gabrielmicko
Copy link

It would help a lot.

@gabrielmicko
Copy link

gabrielmicko commented Jan 20, 2023

OMG, I have been thinking about this all day and it is so simple:

 customSuggestionsContainer={
                isLoading
                  ? () => <div>loading</div>
                  : children => <ul>{children}</ul>
              }

ezgif com-gif-maker

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