Skip to content

Fix addresses containing empty states #33082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/components/AddressSearch/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,11 @@ function AddressSearch({
values.state = stateFallback;
}

// Set the state to be the same as the city in case the state is empty.
if (_.isEmpty(values.state)) {
values.state = values.city;
}

// Some edge-case addresses may lack both street_number and route in the API response, resulting in an empty "values.street"
// We are setting up a fallback to ensure "values.street" is populated with a relevant value
if (!values.street && details.adr_address) {
Expand Down