react-native-google-places-autocomplete icon indicating copy to clipboard operation
react-native-google-places-autocomplete copied to clipboard

Street number truncated off of selected place for details query for certain addresses

Open natalie-zamani opened this issue 3 years ago • 2 comments

Describe the bug

For certain places that are selected in the typeahead options, the street number is always truncated off in the fetch details query, which results in the details being for the incomplete address.

Reproduction - (required - issue will be closed without this)

Can always reproduce using the address: 2 Relmar Road, Toronto, ON, Canada, where the query made to fetch details is: "https://maps.google.com/?q=Relmar+Rd,+Toronto,+ON+M5P,+Canada. This removes the 2 street number, and results in the wrong address being returned.

Additional context

  • Library Version: 2.4.1

  • React Native Version: 0.69.5

  • [x] iOS

  • [ ] Android

  • [ ] Web

If you are using expo please indicate here:

  • [ ] I am using expo

Add any other context about the problem here, screenshots etc

GooglePlaceData

{description: "2 Relmar Road, Toronto, ON, Canada", ...}

GooglePlaceDetail

address_components: Array(7)
  0: {long_name: "Relmar Road", short_name: "Relmar Rd", types: ["route"]}
  1: {long_name: "Old Toronto", short_name: "Old Toronto", types: Array(3)}
  2: {long_name: "Toronto", short_name: "Toronto", types: Array(2)}
  3: {long_name: "Toronto", short_name: "Toronto", types: Array(2)}
  4: {long_name: "Ontario", short_name: "ON", types: Array(2)}
  5: {long_name: "Canada", short_name: "CA", types: Array(2)}
  6: {long_name: "M5P", short_name: "M5P", types: Array(2)}
formatted_address: "Relmar Rd, Toronto, ON M5P, Canada"

natalie-zamani avatar Sep 07 '22 00:09 natalie-zamani