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.

Hide listView onBlur of the textInput.

See original GitHub issue

I have asked this same thing in #18 but that issue is already closed, I thought I need to open a new one, so…

@myaskevich @FaridSafi I have created a variable called shouldDisplayListView and set listViewDisplayed to that as shown in code below:

let shouldDisplayListView = false;
<GooglePlacesAutocomplete listViewDisplayed={shouldDisplayListView}
    textInputProps={{
        onFocus: () => shouldDisplayListView = true;
        onBlur: () => shouldDisplayListView = false;
    }} ............ />

But still I cannot see the listView. Instead if I set listViewDisplayed to “auto” then I can see the listView. But then onBlur of textInput I am unable to hide it.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:12

github_iconTop GitHub Comments

5reactions
IrinaCodixiscommented, Apr 26, 2018

I suggest you use states. This worked in my case:

constructor(props) {
    super(props);   
    this.state = {
      showPlacesList: false
    };
  }

<GooglePlacesAutocomplete 
    listViewDisplayed={this.state.showPlacesList}
    textInputProps={{
       onFocus: () => this.setState({showPlacesList: true}),
       onBlur: () => this.setState({showPlacesList: false}),
    }}............ />
1reaction
IrinaCodixiscommented, May 16, 2018

@Manoj002 , probably it is not compatible with your RN version. I am sorry I couldn’t help you with this. Hopefully dblackker’s PR will be merged soon.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hidden focus on blur of an input element in dom
I am triggering an update event of that control after editing the fields in list view. The list view control is having some...
Read more >
lightning-input-field - documentation - Salesforce Developers
Use the lightning-input-field component in lightning-record-edit-form to display and edit the value of a record field of a Salesforce object.
Read more >
TextField - NativeScript Docs
Hides the soft input method, ususally a soft keyboard. Events. Name, Description. blur, Emitted when the text field is unfocused. focus ...
Read more >
Text Field - Kodika.io Documentation
The text that is displayed when the Text Field has no (text. The user cannot edit it, and it will hide automatically when...
Read more >
Class ListView | UI Toolkit | 1.0.0-preview.18 - Unity - Manual
\ \ The logic required to create VisualElements, and to bind them to or unbind them from the data source, varies depending on...
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