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.

Search & searchable Dropdown: `Results not found` message is rendered while `loading` is still true & onFocus

See original GitHub issue

Bug Report

A Search component displays No results found message while loading. In a searchable Dropdown, on focus before a search has been made and while loading this message is also displayed.

renderOptions() in Dropdown.js & renderMenuContent() in SearchResults.js do not check for loading or query value which would cause this behaviour. Adding && !loading to the if statements would fix this.

Steps

Create a search component as per Semantic’s standard example (see CodePen) and search for data. Create a Form with a Field. The field should have controls set to a {Dropdown} component as per Semantic’s Forms.Field component example but with searchable variations (see CodePen). Search with text.

Expected Result

The components should not show the No Results Found Message if the results are only loading. The component should not show this message just because the query is empty.

Actual Result

The message is shown in these situations.

Version

0.78.2

Testcase

https://codesandbox.io/s/n7pq0nkqr4

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:8
  • Comments:5

github_iconTop GitHub Comments

1reaction
fredrikolovssoncommented, Aug 29, 2018

@levithomason would you accept a PR with a fix according to @daveJS133 suggestion? I’m encountering this too.

0reactions
winchellcommented, Oct 17, 2022

This seems to work.

<Search
  ...
  loading={loading}
  showNoResults={loading ? false : true}
/>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to close the opened searchable dropdown on back ...
When the focus state is true the FlatList is rendered that contains the items (code reference). The problem is that when you press...
Read more >
Dropdown - Semantic UI React
A selection dropdown can allow a user to search through a large list of choices. Try it CodeSandboxMaximizePermalink. Select Country.
Read more >
How to Use Browser Event Listeners in React for Search and ...
If we open up our browser, type a few characters for some results (like sky ) and hit down, we should see we...
Read more >
lightning-input - documentation - Salesforce Developers
The component also provides a commit event, which the HTML <input> does not have. See Event Handling for details. Checkbox. Checkboxes let you...
Read more >
Combo box
If true , pressing Tab while an autocompleted option is displayed will select it without moving the focus. If false pressing Tab moves...
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