ant-design / ant-design/pro-components
🐛[BUG] LightFilter表单下ProFormTreeSelect增加rules,修改后不会自动触发提交事件
- Dominant language
- TypeScript
- Stars
- 4.8k
- Forks
- 1.4k
- Avg merge
- 10h 44m
- Merged PRs (30d)
- 3
Description
### 🐛 bug 描述
LightFilter表单下ProFormTreeSelect增加rules,修改后不会自动触发提交事件
### 📷 复现步骤
不增加rules,选择后会自动触发onSubmit,增加后不会触发
在LightFilter中增加Button 会报
Warning: React does not recognize the `fieldProps` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `fieldprops` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
### 🏞 期望结果
选择后,在验证rules成功的情况下自动触发onSubmit
### 💻 复现代码
```
bordered
collapseLabel={}
onFinish={async (values) => {
run(values);
}}
>
something}
name="locations"
label="区域"
rules={[requiredRule, { type: 'array', max: 8, min: 1 }]}
transform={(values, name) => {
return { [name]: values.map((item: { value: string }) => item.value).join(',') };
}}
fieldProps={{
treeCheckStrictly: true,
treeCheckable: true,
showCheckedStrategy: TreeSelect.SHOW_PARENT,
multiple: true,
fieldNames: {
label: 'name',
value: 'id',
},
}}
/>
查询
```
### © 版本信息
- ProComponents 版本: [2.6.35]
- umi 版本
- 浏览器环境 chrom
- 开发环境 windos
### 🚑 其他信息
Contributor guide
Research direction
Start by reproducing the LightFilter and ProFormTreeSelect example with and without rules, checking whether selection triggers onFinish and whether the Button produces the fieldProps warning. Trace the LightFilter and ProFormTreeSelect entry points to identify the differing behavior; done means valid selection changes automatically trigger onFinish without the warning.
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