ant-design / ant-design/pro-components

🧐[问题] protable使用cancelEditable取消当前行的编辑,我该怎样将输入框的值重置为编辑前的值?

Open
#8,105 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

### 🧐 问题描述

当我编辑当前行的文本框,然后使用cancelEditable取消编辑,再次进入当前行编辑状态,当前文本框会显示编辑后的值。我该怎样将文本框的值重置为原始数据?

### 💻 示例代码
{
if (currentEditKey?.current) {
actionRef?.current?.cancelEditable(currentEditKey?.current);
}
actionRef?.current?.startEditable(record.id);
currentEditKey.current = record.id;
}}
>
修改

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start with the ProTable editable API around cancelEditable and startEditable, using the supplied onClick flow and record.id as the reproduction. Check how the edited row value is retained after cancellation; done means the reset behavior is established and covered by an appropriate test or documented usage.

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
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.