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.

Upgrade React Native V .61 On Select Does Not Work

See original GitHub issue

Describe the bug

I updated to react native version 0.61.4 and now onSelect is not working. I am able to populate the places in the search box successfully, but when I go to select the location nothing happens. I can not select or generate any data or details about the location.

To Reproduce

Steps to reproduce the behavior:

  1. Set up GooglePlacesAutocomplete as github describes (https://github.com/FaridSafi/react-native-google-places-autocomplete)
  2. In search box, type in location
  3. Click on location
  4. View console.logs (or alert or whatever if it you need to do to see the data and details values)
  5. No console outputs are displayed, no data is pulled

Expected behavior

Expected to see the console display the locations details and data.

Code Example (required - issue will be closed without this)

Please provide a copy of your usage of the <GoogleAutoComplete /> component between the triple ticks below:

Click to expand!
<GooglePlacesAutocomplete
      debounce={200}
      ref={(c) => (googlePlacesAutocomplete = c)}
      keyboardAppearance={"light"}
      listViewDisplayed={false}
      minLength={2}
      placeholder="Search..."
      autoFocus={false}
      returnKeyType={"search"}
      fetchDetails={true}
      getDefaultValue={() => ""}
      keyboardShouldPersistTaps={"always"}
      query={{
        key: API_KEY,
        language: "en", // language of the results
        types: "(cities)",
      }}
      styles={{
        textInputContainer: {
          backgroundColor: "rgba(0,0,0,0)",
          borderTopWidth: 0,
          borderBottomWidth: 0,
        },
        textInput: {
          marginLeft: 0,
          marginRight: 0,
          height: 38,
          color: "#5d5d5d",
          fontSize: 16,
          borderBottomWidth: 1,
          borderColor: Colors.LightMustardYellow,
        },
        description: {
          fontWeight: "bold",
          fontSize: 12,
        },
        predefinedPlacesDescription: {
          color: "black",
        },
      }}
      renderDescription={(value) => value.description}
      onPress={(data, details) => {
        // 'details' is provided when fetchDetails = true
        updateLocationArray(data, details, timeFrame);
        googlePlacesAutocomplete._handleChangeText("");
      }}
    />

Please remember to remove you google API key from the code you provide here

Alternatively, you can link to a snack.

Screenshots

If applicable, add screenshots to help explain your problem.

Where is this bug happening

  • [X ] iOS
  • [ X] Android
  • [ X] Web

If you are using expo please indicate here:

  • [ X] I am using expo

Version Information (please complete the following information)

Library Version: ^1.3.9 React Native Version: 0.61.4 Expo Version: 3.18.6

Additional context

Things I have tried: adding onBlur with console.log function, keyboardShouldPersistTaps = {“handled”}, keyboardShouldPersistTaps = “handled”, keyboardShouldPersistTaps = “always”

I know that there is a nested flatlist issue with the RN upgrade which is most likely causing the issue: VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead. am I am seeing threads of other people having this issue but all of the solutions have not worked for me. Not sure if it is my expo or if the package is out of date. But any help would be greatly appreciated.

Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5

github_iconTop GitHub Comments

13reactions
oporter1commented, May 18, 2020

ah I got it. This article helped a lot - https://medium.com/codespace69/react-native-react-native-google-places-autocomplete-onpress-callback-not-working-23ddf2f7a98f - I needed to add the keyboardShouldPersistTaps to the ScrollView tag…not the GooglePlacesAutoComplete

0reactions
KrisLaucommented, Sep 9, 2021

keyboardShouldPersistTaps doesn’t work for me

Read more comments on GitHub >

github_iconTop Results From Across the Web

Upgrading to new versions - React Native
Some upgrades won't be done automatically with the React Native CLI and require manual work, e.g. 0.28 to 0.29 , or 0.56 to...
Read more >
Upgrading React Native from 0.61.5 to 0.62.3 - Medium
Step 1: Upgrading react-native and related · In the [libs] section, replace node_modules/react-native/Libraries/react-native/react-native- ...
Read more >
Upgrading a React Native app from 0.60 to 0.65 - YouTube
Jamon attempts to upgrade a React Native app from 0.60 to 0.65 with ... mixed results. ... Your browser can 't play this...
Read more >
React Native Upgrade Helper
What's your current react-native version? ... Check out Upgrade Support if you are experiencing issues related to React Native during the upgrading process....
Read more >
Upgrading react native to latest version - Stack Overflow
My advice is to upgrade to the latest version. There will be enough dependency issues anyway so you're best dealing with them only...
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