Handle address data more gracefully

Helps avoid having embarrassments at the conference
This commit is contained in:
Eli Ribble 2026-03-24 05:31:38 +00:00
parent 69eabe4e85
commit 6fe107601e
No known key found for this signature in database
3 changed files with 18 additions and 11 deletions

View file

@ -201,7 +201,14 @@ class AddressInput extends HTMLElement {
}
SetValue(suggestion) {
this.value = suggestion.properties.formatted_address_line;
const props = suggestion.properties;
if (props.formatted_address_line) {
this.value = props.formatted_address_line;
} else if (props.address_components) {
this.value = `${props.address_components.number ?? ""} ${props.address_components.street ?? ""}, ${props.coarse_location ?? ""}`;
} else {
this.value = `${props.name ?? ""}, ${props.coarse_location}`;
}
this._suggestions.innerHTML = "";
}
}