Missing brackets in places-autocomplete-addressform

未关闭
#1,637 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
typescript
领域
frontend

调研方向

从 samples/places-autocomplete-addressform/index.ts 开始,检查处理地址组件的 switch 语句,尤其是 Locality 和 Country。移除 HTML 中的 country 字段,并检查邮政编码是否会被填充,以复现该问题。完成的标准是:示例在没有 country 字段的情况下能够正常工作,并且地址表单仍然保持可用。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
TypeScript
星标
804
派生
826
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

googlemaps/js-samples 的其他 Issue

查看 googlemaps/js-samples 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。