diff --git a/src/components/AddressSearch/index.js b/src/components/AddressSearch/index.js index e761ebeed26b..1697dddba805 100644 --- a/src/components/AddressSearch/index.js +++ b/src/components/AddressSearch/index.js @@ -95,6 +95,9 @@ const propTypes = { /** Maximum number of characters allowed in search input */ maxInputLength: PropTypes.number, + /** The result types to return from the Google Places Autocomplete request */ + resultTypes: PropTypes.string, + /** Information about the network */ network: networkPropTypes.isRequired, @@ -123,6 +126,7 @@ const defaultProps = { }, maxInputLength: undefined, predefinedPlaces: [], + resultTypes: 'address', }; // Do not convert to class component! It's been tried before and presents more challenges than it's worth. @@ -134,10 +138,10 @@ function AddressSearch(props) { const query = useMemo( () => ({ language: props.preferredLocale, - types: 'address', + types: props.resultTypes, components: props.isLimitedToUSA ? 'country:us' : undefined, }), - [props.preferredLocale, props.isLimitedToUSA], + [props.preferredLocale, props.resultTypes, props.isLimitedToUSA], ); const saveLocationDetails = (autocompleteData, details) => { diff --git a/src/pages/iou/WaypointEditor.js b/src/pages/iou/WaypointEditor.js index 8c168a456210..68e85a34746d 100644 --- a/src/pages/iou/WaypointEditor.js +++ b/src/pages/iou/WaypointEditor.js @@ -222,6 +222,7 @@ function WaypointEditor({transactionID, route: {params: {iouType = '', waypointI state: null, }} predefinedPlaces={recentWaypoints} + resultTypes="" />