Missing brackets in places-autocomplete-addressform

Đang mở
#1,637 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
1/5
Thời gian dự kiến
Dưới một giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Bắt đầu với samples/places-autocomplete-addressform/index.ts và kiểm tra câu lệnh switch xử lý các thành phần địa chỉ, đặc biệt là Locality và Country. Tái hiện sự cố bằng cách xóa trường country khỏi HTML và kiểm tra xem mã bưu chính có được điền hay không. Được coi là hoàn thành khi sample hoạt động chính xác mà không có trường country và biểu mẫu địa chỉ vẫn hoạt động bình thường.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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

Ngôn ngữ chính
TypeScript
Star
804
Fork
826
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của googlemaps/js-samples

Tất cả issue của googlemaps/js-samples

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.