ant-design / ant-design/pro-components

🐛[BUG] 可编辑表格name模式时,rowkey设置问题

Open
#8,544 2 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 描述

可编辑表格,rowKey设置为id或者任何一个string,如果其值和index相同的时候,比如id=3,editableKeys设置这个行[3]可编辑的时候会同时选择index=3和id=3的行可编辑。
https://github.com/ant-design/pro-components/issues/7347#issue-1796430134
之前一个issue也是这个原因

### 📷 复现步骤

![image](https://github.com/ant-design/pro-components/assets/54090374/588b0b57-837c-4753-8a62-9ea9b3623327)

### 🏞 期望结果

期望只选中rowkey

### 💻 复现代码

https://stackblitz.com/edit/react-t1bxma?file=App.tsx

### © 版本信息

- ProComponents 版本: "@ant-design/pro-components": "^2.7.10",
- 浏览器环境 [chrome 126.0.6478.127]
- 开发环境 [win]

### 🚑 其他信息

Contributor guide

Open the contributing guide

Research direction

Start with the linked StackBlitz reproduction in App.tsx and reproduce the editable-table case where rowKey and an index share the same value. Trace the editableKeys matching behavior in the editable table implementation. Done means selecting editableKeys for a row activates only the row identified by rowKey, not another row with the same index.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.