pro-components icon indicating copy to clipboard operation
pro-components copied to clipboard

🐛[BUG]ProFormDateTimePicker在grid模式下不能正确表现宽度

Open finalmachine opened this issue 3 years ago • 2 comments

🐛 bug 描述

ProFormDateTimePicker在form开启grid属性的时候colProps属性无效

📷 复现步骤

见复现代码

🏞 期望结果

image

🏞 实际效果

image

💻 复现代码

<ModalForm<OrderFormInfo> grid={true}> <ProForm.Group> <ProFormDateTimePicker style={{ width: '332px' }} label="下单时间" colProps={{xl: 12}} name="orderTime" required grid={true} }} /> <ProFormText disabled colProps={{xl: 12}} name="pay" label="支付方式"/> </ProForm.Group> </ModalForm>

© 版本信息

  • ProComponents 版本: ["@ant-design/pro-components": "2.3.10"]
  • 浏览器环境[Microsoft Edge版本 105.0.1343.42 (正式版本) (arm64)]
  • 开发环境 [mac OS 12.6]

🚑 其他信息

个人建议,我觉得.ant-picker这个样式缺少width: 100%

finalmachine avatar Oct 27 '22 09:10 finalmachine

以下的 Issues 可能会帮助到你 / The following issues may help you

  • [#5967][🐛[BUG]ProFormDateTimePicker在grid模式下不能正确表现宽度][100%]
  • [#5966][ProFormDateTimePicker在grid模式下不能正确表现宽度][100%]

github-actions[bot] avatar Oct 27 '22 09:10 github-actions[bot]

我之前提交过这个bug,但是管理者说加上width字段,然后关掉了bug,我觉得这样是不合理的,所以重新提交了这个bug。grid模式下,width属性应该是不生效的,所以我需要管理者重新看一下这个bug怎么解决

finalmachine avatar Oct 27 '22 09:10 finalmachine

TAutomatically replying with ChatGPT can be attempted, but it cannot be guaranteed to be completely accurate and may not fully address all issues. Please feel free to reply if you have any further questions or concerns. 此回复基于 ChatGPT 自动生成,可以尝试下方案,官方员会在一定时间后继续继续处理。

非常感谢你的反馈和提供的复现代码。

我已经查看了之前的 Issue (#5967) 以及你的新 Issue。在这里给你一些解决方案:

  1. 确认使用的 Pro Components 版本是否是最新的稳定版本:2.3.15,因为在之前的版本会出现你复现的问题。

  2. 如果使用的是最新的版本依然存在此问题,请确认你的使用方式是正确的,即在 <ProForm.Item> 中使用 <ProFormDateTimePicker>

  3. ProFormDateTimePicker 组件提供了 width 参数,并且在 grid 模式下是可以生效的。

  4. 如果以上解决方案不能解决你的问题,请提供更多的代码以及更详细的复现步骤,以便我们更好地定位问题。

希望以上解决方案对你有所帮助。如果你还有其他问题,欢迎继续反馈。

chenshuai2144 avatar Mar 06 '23 10:03 chenshuai2144

t

我是用了2.3.38这个版本,发现现在是用width属性确实可以指定宽度了,这样如果ModalForm的宽度和预期的一样确实会得到正确的展示。但是依然希望antd早日修复ProFormDateTimePicker在grid模式的bug。

finalmachine avatar Mar 07 '23 14:03 finalmachine

TAutomatically replying with ChatGPT can be attempted, but it cannot be guaranteed to be completely accurate and may not fully address all issues. Please feel free to reply if you have any further questions or concerns. 此回复基于 ChatGPT 自动生成,可以尝试下方案,官方人员会在一定时间后继续继续处理。

感谢您的回复,确实相比于使用width属性而言,修复这个 bug 才能解决其本质问题,防止一些不必要的问题和代码复杂度增加,也希望相关团队能够尽快修复这个问题。如有其他疑问,请继续提出。

chenshuai2144 avatar Mar 08 '23 07:03 chenshuai2144

这样搞, DatePick 不知道为啥没有默认百分之百 image

chenshuai2144 avatar Jul 15 '23 14:07 chenshuai2144