public getComponentByType(address: Address, type: string): AddressComponent {
if (!type)
return null;
if (!address || !address.address_components || address.address_components.length == 0)
return null;
type = type.toLowerCase();
for (let comp of address.address_components) {
if (!comp.types || comp.types.length == 0)
continue;
if (comp.types.findIndex(x => x.toLowerCase() == type) > -1)
return comp;
}
return null;
}
This first address, which is outside of the US, causes the page to become unresponsive and crash:
"1519 Prindsen Gade Charlotte Amalie, St Thomas"
This second address doesn't return a street number despite entering one and picking corresponding option which includes the street number:
"21627 Hardingrove Road, Milesville, SD, 57553"
Is there anything that can be done to fix these things? Is this on Google or is it me? Thanks!
So we've had the autocomplete live on our site for several weeks and our QA person found some issues that I can't quite put a finger on.
Here's the options in my component:
Here's my handleAddressChange method:
getComponentByType:
This first address, which is outside of the US, causes the page to become unresponsive and crash: "1519 Prindsen Gade Charlotte Amalie, St Thomas"
This second address doesn't return a street number despite entering one and picking corresponding option which includes the street number: "21627 Hardingrove Road, Milesville, SD, 57553"
Is there anything that can be done to fix these things? Is this on Google or is it me? Thanks!