-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛[BUG]使用ModalForm加ProFormText渲染弹框表单,出现校验信息导致表单项高度变化的问题 #8942
Comments
以下的 Issues 可能会帮助到你 / The following issues may help you
|
@andriijas 有大佬来帮忙看看吗,为什么渲染结果会跟demo有区别的,是我什么参数没有设置吗 |
我已经排查出问题了,版本问题导致的,我暂时找不到什么hack的方法,只能选择版本回退,或者不要使用ProForm,使用完全使用antd来开发,对应回退的版本参照官方demo,对应的是,@ant-design/pro-components": "2.7.16", "antd": "5.20.0", |
The link is empty. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
提问前先看看:
https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md
🐛 bug 描述
使用ModalForm加ProFormText渲染弹框表单,当进行表单校验,错误信息出现或消失时,表单Item会高度变化,
我分析了官方demo,和我渲染的内容的dom,发现
官方demo渲染提示信息时,外层有一个div包裹,而我渲染的则没有,这个就是问题的原因
缺少了样式style="width: 0px; height: 24px;"
📷 复现步骤
🏞 期望结果
表单在校验信息出现和消失时,表单高度不会变化
💻 复现代码
<ModalForm<API.EnterpriseRespDto> title={id ? t({ id: 'F.编辑企业' }) : t({ id: 'F.添加企业' })} formRef={formRef} open={visible} onOpenChange={(v) => setVisible(v)} width="540px" onFinish={onFinish} > <ProFormText name="enterpriseName" label={t({ id: 'F.企业名称' })} validateTrigger="onBlur" rules={[{ required: true, message: t({ id: 'N.企业名称是必填项' }) }]} fieldProps={{ maxLength: 100 }} /> <ProFormText name="enterpriseCode" label={t({ id: 'F.企业CODE' })} disabled={!!id} validateTrigger="onBlur" rules={[{ required: true, message: t({ id: 'N.企业CODE是必填项' }) }]} fieldProps={{ maxLength: 100 }} />
© 版本信息
🚑 其他信息
官方demo截图:
我代码运行的截图:
The text was updated successfully, but these errors were encountered: