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.

Question: Why is onSuggestSelect fired when there's no user input?

See original GitHub issue

My project uses react-geosuggest for a search bar, and we’ve been seeing a bunch of sentry errors where our onSuggestSelect function is expecting to find a property on the suggestion passed to the function but does not find it. It seemed weird that this error is being thrown at all.

I figured out that I can replicate the error by:

  1. Let the page load
  2. Enter some text into the searchbar
  3. Delete that text
  4. Click out of the searchbar

This code is the source of the issue. I’d call it a bug except that it seems to have been coded this way intentionally - why was that?

I could pretty easily wrap my onSuggestSelect function with a check to make sure that the suggestion exists, but that seems like a hack.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:3
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
tstirrat15commented, Mar 20, 2018

@danawhite by checking that the desired properties are present in the suggestion in the callback for onSuggestSelect. It’s hackish but it works…

0reactions
ro-kacommented, May 22, 2018

The code was introduced with PR https://github.com/ubilabs/react-geosuggest/pull/350. We need to make sure to keep the intended behaviour.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is my program getting terminated when i enter user input?
I think I am not comparing the strings correctly. I tried using compare function but still it did not work. #include <iostream> #include ......
Read more >
How to tell if TextChanged fired in response to user input
I am finding that the TextChanged event is firing during databinding, as it should, but this is blowing away the manually overridden calculation ......
Read more >
@nrk/core-suggest - npm
@nrk/core-suggest enhances an input, providing keyboard accessible functionality for autocompletion, search results and smart select box ...
Read more >
platform/frameworks/base - Git at Google
There - * can be at most one listener per config key. ... "Could not access statsd to inform it of pulling alarm...
Read more >
com.google.android.as_1.4.245987093.apk - Hybrid Analysis
Not all malicious and suspicious indicators are displayed. ... initiate a phone call without going through the Dialer user interface for the user...
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