question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Custom loading Icon in dropdown

See original GitHub issue

Is your feature request related to a problem? Please describe. When the isLoading prop is set to true it shows a ‘loading’ text. I think it would be nice to have an option to show a custom loading icon when isLoading is set to true.

Describe the solution you’d like Just to add loading prop which could be a node.

Additional context You can take a look at Antd library’s dropdown loading. It appears like the empty state of the dropdown (items not found) but shows a spinner instead of text.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ericgiocommented, Apr 1, 2020

Yes that’s right. So actually you’d also need to pass an empty array to options as well so the empty state shows up:

<Typeahead
  ...
  emptyLabel={isLoading ? <MyLoader /> : 'No results'}
  options={isLoading ? [] : options}
/>

Alternatively, you can use renderMenu to handle things however you want.

0reactions
ericgiocommented, Apr 1, 2020

Sorry you had trouble finding the information you were looking for. Unfortunately it’s impractical to account for every use case in the docs, so I try to cover the more common or general cases there. This case might be a good candidate for the example section. If you’d like to create a sandbox and submit a PR adding it to the README, I’d be happy to merge it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Page loading icon when some one click a drop-down nav item ...
I have this loader script below to display loading icon when my index page loads. But i dont know how to use this...
Read more >
Dropdown Icon | Free SVG / PNG, Premium Animated GIF ...
Loading.io's icon library provides thousands of icons that are all customizable and animatable. You can choose up to 100+ animations and apply to...
Read more >
[SOLVED] Small Loader icon while filling a dropdown
I've seen the Loader icon on filling a TreeView Node and it looks very nice — not only ... If you want to...
Read more >
How To Create Loading Buttons - W3Schools
Tip: Go to our Icons Tutorial to learn more about icons. Tip: Go to our How To - CSS Loader to learn how...
Read more >
Spinners - Bootstrap
They're built only with HTML and CSS, meaning you don't need any JavaScript to create them. You will, however, need some custom JavaScript...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found