ant-design / ant-design/pro-components
🐛[BUG]BetaSchemaForm组件,重置或form.resetFields时,会调用request
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
### 🐛 bug 描述
BetaSchemaForm重置或form.resetFields时,会调用request,重置只应该重置initialValues,不应该做其他操作。且大量表单情况,容易造成卡死
### 📷 复现步骤
https://codesandbox.io/s/dong-tai-kong-zhi-shi-fou-chong-xuan-ran-forked-5sttmn?file=/App.tsx

### 🏞 期望结果
form.resetFields只重置initialValues。
### 💻 复现代码
```javascript
import { BetaSchemaForm } from "@ant-design/pro-components";
const waitTime = (time) => {
return new Promise((resolve) => {
setTimeout(() => {
console.log("requested...");
resolve(true);
}, time);
});
};
const columns = [
{
title: "select",
dataIndex: "select",
request: async () => {
await waitTime(100);
return [
{
value: "value1",
label: "label1"
}
];
}
}
];
export default () => {
return (
);
};
```
### © 版本信息
- ProComponents 版本: 最新版本会出现,即pro-form 2.18.1
### 🚑 其他信息
期望尽快解决哈
Contributor guide
Research direction
Reproduce the behavior in the linked CodeSandbox using BetaSchemaForm with a request column and form.resetFields. Trace the BetaSchemaForm and pro-form reset flow, then verify that resetting restores initialValues without invoking request, including with many forms to ensure it does not cause the reported freeze.
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
- 45/100