Skip to content

Commit

Permalink
Merge pull request #26682 from Expensify/neil-distance-places
Browse files Browse the repository at this point in the history
Show suggestions for places in distance requests
  • Loading branch information
Hayata Suenaga authored Sep 4, 2023
2 parents 1c8eaa7 + 89598d8 commit f77a5a5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/AddressSearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down Expand Up @@ -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.
Expand All @@ -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) => {
Expand Down
1 change: 1 addition & 0 deletions src/pages/iou/WaypointEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ function WaypointEditor({transactionID, route: {params: {iouType = '', waypointI
state: null,
}}
predefinedPlaces={recentWaypoints}
resultTypes=""
/>
</View>
</Form>
Expand Down

0 comments on commit f77a5a5

Please sign in to comment.