Closed m-natarajan closed 1 year ago
Triggered auto assignment to @kevinksullivan (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)We want to show correct suggestions in the address field based on the user's selected country, instead of showing from all countries
In the AddressPage
, we pass isLimitedToUSA={false}
, which then makes the components
key in query
as undefiend
here, which then shows all matching suggestions from all countries instead of the just the selected country
<AddressSearch/>
uses google places autocomplete to show autofill suggestion
We should update the search query in <AddressSearch/>
based on the user's selected country.
So instead of using isLimitedToUSA
prop <AddressSearch/>
, I suggest we use a countryISO
prop with a default value of 'US', and update the query to be something like this
// pseudocode
const query = useMemo(
() => ({
language: props.preferredLocale,
types: 'address',
components: props.countryISO ? `country:${props.countryISO}` : undefined,
}),
[props.preferredLocale, props.countryISO],
);
and from the <AddressPage/>
we pass countryISO={currentCountry}
to <AddressSearch/>
which would give relevant autofill suggestions.
In case if a user has no selected country, we can pass countryISO={null} // or undefined
which would suggest search results from all locations/countries.
N/A
I think this is a new feature. Asking here
not a bug, it's a new feature
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
If a user has a selected country, the autofill show only show locations from that country, and if the user has no selected country, the autofill should show suggestions from all locations.
Actual Result:
The autofill shows suggestions from all locations, instead of the selected country
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.56-14 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/38435837/2e781838-850a-4d95-9834-2d48e6a977dd
https://github.com/Expensify/App/assets/38435837/8891c595-572d-4432-85e1-a67e6f718355
Expensify/Expensify Issue URL: Issue reported by: @huzaifa-99 Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692011103310569
View all open jobs on GitHub