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 Report

Merging #414 into master will not change coverage.
The diff coverage is 0.00%.

Impacted file tree graph

@@           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           
Impacted Files Coverage Δ
src/MentionsInput.js 68.75% <ø> (ø)
src/SuggestionsOverlay.js 66.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ad1a281...26f6f3c. Read the comment docs.

@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