ant-design / ant-design/pro-components

🐛[BUG] ProFormCascader组件的只读模式在部分情况下回显错误

Open
#9,023 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

提问前先看看:

https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md

### 🐛 bug 描述

https://github.com/ant-design/pro-components/blob/master/packages/field/src/components/Cascader/index.tsx#L83

这里使用了Map来存放级联选择器中所有层级的[value, label],如果不同层级中的value重复,就会发生覆盖情况,导致回显错误

### 📷 复现步骤

### 🏞 期望结果

### 💻 复现代码

### © 版本信息

- ProComponents 版本: [e.g. 4.0.0]
- umi 版本
- 浏览器环境
- 开发环境 [e.g. mac OS]

### 🚑 其他信息

Contributor guide

Open the contributing guide

Research direction

Start by reading packages/field/src/components/Cascader/index.tsx around line 83, focusing on how the Map stores values and labels across cascade levels. Reproduce the read-only ProFormCascader case with repeated values at different levels, then verify that repeated values no longer overwrite one another and the displayed labels are correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.