pro-components
pro-components copied to clipboard
🐛[BUG] LightFilter表单下ProFormTreeSelect增加rules,修改后不会自动触发提交事件
🐛 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
💻 复现代码
<LightFilter<API.ElectricChartParams>
bordered
collapseLabel={<FilterOutlined />}
onFinish={async (values) => {
run(values);
}}
>
<ProFormTreeSelect
request={()=> 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',
},
}}
/>
<Button type="primary" htmlType="submit">
查询
</Button>
</LightFilter>
© 版本信息
- ProComponents 版本: [2.6.35]
- umi 版本
- 浏览器环境 chrom
- 开发环境 windos
🚑 其他信息
+1