ant-design / ant-design/pro-components

🐛[BUG]editable-table列子与formItem结合,使用筛选条件后,编辑出现错乱

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

editable-table列子与formItem结合,使用筛选条件后,编辑出现错乱,显示的是之前第一行的数据。点取消按钮会错乱。
使用分页情况,编辑表格数据也会错乱

### 📷 复现步骤

官方的:与 FormItem 配合,列的状态字段添加
filters: true,
onFilter: (value, record) => record.state?.indexOf(value) == 0,
筛选之后,会出现编辑数据错乱

### 🏞 期望结果

能正常编辑数据

### 💻 复现代码

filters: true,
onFilter: (value, record) => record.state?.indexOf(value) == 0,

### © 版本信息

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

### 🚑 其他信息

![1](https://github.com/user-attachments/assets/d1c8e8e8-477d-42a4-a35f-c3117e8359f6)
![2](https://github.com/user-attachments/assets/d430d207-79dc-49bf-8a3d-ea99fea44718)
![3](https://github.com/user-attachments/assets/fe4d098c-c817-4da1-978f-16aa3d996a70)

Contributor guide

Open the contributing guide

Research direction

Start from the editable-table example that combines FormItem with column filters, using the reported state filter and onFilter callback. Reproduce the issue after filtering and with pagination, then verify that editing and cancelling continue to target the displayed row's data rather than the first row.

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.