googlemaps / googlemaps/js-samples

Missing brackets in places-autocomplete-addressform

Open
#1,637 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
805
Forks
836
PR merge metrics
No merged PRs in 30d

Description

### Operating system

Win11

### Browser Version

Edge 120.0.2210.77

### How severe is the bug?

low

### Bug description

When reusing the example from samples/places-autocomplete-addressform/index.ts, there are some curly brackets missing in the switch statement. "Locality" and "Country" don't have open/close brackets. This seems to work fine unless you remove the country field from the HTML and then the zip code portion breaks. Once you add in the appropriate brackets, it starts working correctly without the country field.

### Steps to reproduce

Run the code as described on https://developers.google.com/maps/documentation/javascript/examples/places-autocomplete-addressform#maps_places_autocomplete_addressform-javascript. Remove the country field from the HTML and see that Zip Code isn't populated. Edit the script to add the appropriate brackets and it starts working again.

### Console log output

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.