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.

Disabling NoOptionsMessage

See original GitHub issue

Currently it doesn’t seem as though there’s a way to disable the “NoOptions” message entirely. You can set it to a different text, or style it with a custom component, but you cannot set it to null and remove the component, like you can with ie. IndicatorSeparator. Setting NoOptionsMessage component to null results in a rendering error and setting it to () => null results in a blank rounded box as shown here: https://codesandbox.io/s/react-codesandboxer-example-0exfd

Would be nice to be able to disable the message entirely, ie. by setting the component to null.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
jnelkencommented, Oct 14, 2019

There is a way to fix this: use the noOptionsMessage top-level prop (not the same as the components object prop value) and set it to () => null

https://codesandbox.io/embed/react-codesandboxer-example-egds8

1reaction
AkshayHerecommented, Aug 1, 2019

Try openMenuOnClick={false} to disble the menu from opening when you click. Results will open the menu, including in the event that there are no options.

It gives me an ‘No options’ message even before API call is made 😦 . Would love to have an option to hide this mesage

Read more comments on GitHub >

github_iconTop Results From Across the Web

react-select How to hide dropdown menu programmatically ...
In V2 you can achieve this by setting noOptionsMessage to a function that returns ... Turn off <Menu /> component to hide dropdown...
Read more >
API - React Select
isOptionDisabled. Override the built-in logic to detect whether an option is disabled. An example can be found in the Replacing builtins documentation.
Read more >
Optimize your react-select component to smoothly render ...
Disable onMouseMove and onMouseOver events ... we know that it is trying to render the “noOptionsMessage” if no options are available.
Read more >
svelte-select - npm
Hide list and don't show noOptionsMessage when there are no items . containerClasses: String Default: '' . ... Disable select.
Read more >
Is there "disabled" attribute for grafana ui components
Hi, I am using <Segment/> from @grafana/ui.I would like to know is there a way to make this component disabled based on the...
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