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.

How to close suggest list on select?

See original GitHub issue

Short description

I was trying to select a suggestion, but the suggestion list doesn’t close after I select a suggestion item. I tried using below code but it didn’t work.

onSuggestSelect(suggest) {
    console.log(suggest);
    this._geoSuggest.blur();
}
<Geosuggest ref={el => (this._geoSuggest = el)} 
          onSuggestSelect={this.onSuggestSelect}
          suggestsHiddenClassName="suggest-hidden"
          suggestItemClassName="suggest-item"/>

I even tried this._geoSuggest.hideSuggests();, but that too didn’t work.

Expected results

By selecting a suggestion item the suggestion list should close.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

7reactions
ro-kacommented, Oct 30, 2017

Looks like some CSS is missing. Did you read this: https://github.com/ubilabs/react-geosuggest#styling ?

4reactions
amackintoshcommented, Nov 27, 2017

Thanks for this thread’s existence.

If anyone else wanders in here, check that above URL for a quick win:

Note: The geosuggest__suggests–hidden class is added to hide the suggestion list. You should copy the style below into your CSS file.

// This closes the suggestion list
.geosuggest__suggests--hidden {
  max-height: 0;
  overflow: hidden;
  border-width: 0;
}

The component is excellent by the way. Deluxe API and amazing piece of technology.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hide autocomplete suggestion list on select dropbdown item ...
Hide autocomplete suggestion list on select dropbdown item and enter click · Subscribe to RSS.
Read more >
Manage suggested recipients in the To, Cc, and Bcc boxes ...
Turn off the Auto-Complete List · Select File > Options > Mail. Choose the File tab. · Under Send messages, clear the Use...
Read more >
Option to not close the dropdown when an item is selected #62
When an item is selected, the dropdown is automatically closed. ... My use case is as follows: When a suggestion is clicked, window.location ......
Read more >
Manage Google autocomplete predictions - Google Search Help
On your Android phone or tablet, open the Google app Google Search . · At the top right, tap your Profile picture or...
Read more >
Siri Suggestions on iPhone - Apple Support
Go to Settings > Siri & Search, scroll down, then select an app. Turn settings on or off. Change where Siri Suggestions appear....
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