Comments (4)
以下的 Issues 可能会帮助到你 / The following issues may help you
- [#8006][🐛[BUG]Table.EXPAND_COLUMN not working][60%]
from pro-components.
validateTrigger 为 onBlur没生效的原因找到了。因为源码中有一个WithValueFomFiledProps组件分隔了form.item和表单组件间的props传递。其中有一个判断
const isProFormComponent = // @ts-ignore filedChildren?.type?.displayName !== 'ProFormComponent';
如果为false的话会导致很多props不会透传给antd的form.item。这个干嘛用的不太清楚。
所以解决方案可以是给自己自定义的组件加上 displayName ="ProFormComponent" 属性就能解决。
不过这个应该不是最终解决方案,还是得看它原来是要干嘛
@chenshuai2144
from pro-components.
重新看了一下就是onBlur没有传进去,跟isProFormComponent无关。
const { children: filedChildren, onChange, onBlur, ignoreFormItem, valuePropName = 'value', ...restProps } = formFieldProps;
omitUndefined({ ...restProps, [valuePropName]: formFieldProps[valuePropName], ...filedChildren.props, onChange: finalChange, fieldProps, })
就是restProps中没有onBlur了,所以没有透传给proformItem下的组件
from pro-components.
在使用 2.7 版本的时候,发现是可以的
当在rules中设置时,无法触发校验,如下:
<ProFormText rules={[ { required: true, validator: validatorFunc, validateTrigger: "onBlur" }, ]} />
当validateTrigger属性放在ProFormText中时,触发可以生效
<ProFormText validateTrigger="onBlur" rules={[ { required: true, validator: validatorFunc }, ]} />
官方文档中也是如此设置,希望有帮助!
from pro-components.
Related Issues (20)
- 使用 EditableProTable renderFormItem 下拉選單 Select 下添加任一標籤<span> form功能無法正常運作
- 🐛[BUG] ProComponents (e.g ProFormUploadButton) not fully internationalized? HOT 1
- ErrorBoundary不支持传入props? HOT 1
- column defaultSortOrder无效 HOT 2
- 🐛[BUG]EditableProTable 在 Form中使用时,受控状态下,取消编辑无效 HOT 1
- 🐛[BUG] ProFormSelect 添加 Style 属性,不会生效 HOT 2
- 🧐[问题] 在ProForm 里 怎么可以在不修改的情况下, 也可以取到 {lable:"dispaly name", value:123} HOT 5
- 🐛[BUG]秒格式化字段类型负数会错误显示 HOT 1
- 👑 [需求]ProTable 里配置columns , valueType: 'treeSelect'的时候,有个场景跟antd的TreeSelect组件不符 HOT 5
- 🧐[问题] Schema Form的valueType:formList,renderFormItem失效
- 🐛[BUG] ModalForm 子元素的`transform`函数会在初始化时触发且忽视`convertValue` HOT 5
- 🐛[BUG] ProTable filterType:'light'时,时间区间相关组件展示与valueType 不符合
- ProLayout的Sider Token没有字体大小设置,使用全局的ConfigProvidert又不生效, 难道没人觉得左侧菜单栏的字体14px太小了吗 HOT 3
- 为什么 DrawerForm onFinish 后 会造成 ProFormDependency 重新渲染 或其 依赖项重新触发 onChange?
- 🧐[问题] HOT 1
- 官网地址打开白屏 HOT 2
- 🐛[BUG]: Virtual ProTable is not able to scroll horizontally in mobile device
- 🐛[BUG] ProFormRadio.Group的className、rootClassName、style等属性不生效 HOT 1
- EditableProTable能修改 popover 校验提示框的方向吗?(默认是 top,希望修改为left)
- Warning: findDOMNode is deprecated and will be removed in the next major release. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here:
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pro-components.