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.

Current Location only displays results when Input is in focus

See original GitHub issue

Clicking on the current Location “blurs” the component which set listViewDisplayed:false.

The results get “loaded”, but not displayed until you re-focus the input component.

I’m not sure if this was intentional but it basically means nothing will happen unless the user clicks on the input box again, triggering the _onFocus function again.

I’m trying to find a hack around this:

    } else if (rowData.isCurrentLocation === true) {
      // display loader
      this._enableRowLoader(rowData);

      this.setState({
        text: this._renderDescription( rowData ),
      });

      // this.triggerBlur(); // hide keyboard but not the results
      delete rowData.isLoading;
      this.getCurrentLocation();

    } else {

I commented out // this.triggerBlur(); // hide keyboard but not the results and it works now as I expect it to.

Why was the blur added and is this the expected behavior?

Issue Analytics

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

github_iconTop GitHub Comments

9reactions
carylawcommented, Mar 30, 2020

my Current Location solution

<GooglePlacesAutocomplete
  currentLocation={true} // Will add a 'Current location' button at the top of the predefined places list
  currentLocationLabel="Current Location"
  nearbyPlacesAPI="GoogleReverseGeocoding"
  textInputProps={{ onBlur: () => {} }}
..../>
2reactions
Sbarcenascommented, Apr 30, 2020

currentLocation={true} // Will add a 'Curr

This works to me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Button does not receive click event when focus is on input ...
The problem is that with static positioning the button requires two clicks for receiving the click event. I have been hours investigating this ......
Read more >
Only fetch on typing and show results on focus #223 - GitHub
Hi there, when using: trigger: { event: ["input", "focus"], },. the result fetching is done every time. But if someone only types in...
Read more >
HTMLElement.focus() - Web APIs | MDN
The HTMLElement.focus() method sets focus on the specified element, if it can be focused. The focused element is the element that will ...
Read more >
New features available with macOS Ventura. - Apple
Preview the latest features, enhancements, app updates, and more in macOS Ventura for Mac.
Read more >
Get the last known location - Android Developers
In your activity's onCreate() method, create an instance of the Fused Location Provider Client as the following code snippet shows. Kotlin Java More....
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