ant-design / ant-design/pro-components
🧐[问题]StepsForm中的下一步按钮如何控制只校验当前StepForm部分必填字段
- 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
### 🧐 问题描述
StepsForm中的下一步按钮当前默认是调用 props.onSubmit() 方法,但实际会校验当前 StepForm 全部必填字段,业务需要涉及在三四层嵌套的 Form.List 中仅校验部分选中项必填字段。
### 💻 示例代码
submitter={{
render: (props) => {
if (props.step === 0) {
return (
props.onSubmit?.()}>
去第二步 {'>'}
);
}
}}
### 🚑 其他信息
Contributor guide
Research direction
Start at StepsForm's submitter render and the props.onSubmit() path shown in the issue, then trace how validation reaches nested Form.List fields. Compare the current whole-step validation with the requested behavior for selected required fields. Done means the next-step action validates only the intended fields while preserving normal step progression.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100