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

How can i restrict places search to a specific country like "US"?

Open munibahina opened this issue 4 years ago • 3 comments

Do you want to request a feature or report a bug?

What is the current behavior?

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

What is the expected behavior?

Which versions of ReactPlacesAutocomplete, and which browser / OS are affected by this issue?

munibahina avatar Jun 09 '21 05:06 munibahina

This should work

<PlacesAutocomplete
  searchOptions={{
    componentRestrictions: {
       country: 'US'
    }
  }}
/>

faraz-dd avatar Dec 07 '21 19:12 faraz-dd

@munibahina They have already provided a workaround for this. You can check this closed issue

SasiKumar-Ramesh avatar Jan 12 '22 08:01 SasiKumar-Ramesh

This should work

<PlacesAutocomplete
  searchOptions={{
    componentRestrictions: {
       country: 'US'
    }
  }}
/>

@munibahina This should solve the issue, i would encourage you to close the issue.

anbturki avatar Jan 18 '22 14:01 anbturki