ant-design icon indicating copy to clipboard operation
ant-design copied to clipboard

RangePicker设置了format=“HH:mm”和默认时间以后,第一次点击后面的时间框,时间选择面板会出现在前一个时间框的下方

Open sakurayeah opened this issue 3 years ago • 1 comments

Reproduction link

https://riddle.alibaba-inc.com/riddles/cbf2005b

Steps to reproduce

第一次进入时(仅第一次进入时能复现),鼠标点击第二个时间选择框,时间选择下拉菜单出现在第一个时间选择框下方,如图所示 123123

What is expected?

鼠标点击第二个时间选择框,时间选择下拉菜单出现在第二个时间选择框下方

What is actually happening?

第一次进入时,鼠标点击第二个时间选择框,时间选择下拉菜单出现在第一个时间选择框下方

Environment Info
antd 4.19.5
React 16.x
System /
Browser Chrome100.0.4896.75

sakurayeah avatar Apr 26 '22 07:04 sakurayeah

Hello @sakurayeah. We totally like your proposal/feedback, welcome to send us a Pull Request for it. Please send your Pull Request to proper branch (feature branch for the new feature, master for bugfix and other changes), fill the Pull Request Template here, provide changelog/TypeScript/documentation/test cases if needed and make sure CI passed, we will review it soon. We appreciate your effort in advance and looking forward to your contribution!

你好 @sakurayeah,我们完全同意你的提议/反馈,欢迎直接在此仓库 创建一个 Pull Request 来解决这个问题。请将 Pull Request 发到正确的分支(新特性发到 feature 分支,其他发到 master 分支),务必填写 Pull Request 内的预设模板,提供改动所需相应的 changelog、TypeScript 定义、测试用例、文档等,并确保 CI 通过,我们会尽快进行 Review,提前感谢和期待您的贡献。

giphy

github-actions[bot] avatar Oct 26 '22 08:10 github-actions[bot]

我最近也遇到这个bug了,在网上没找到答案,自己摸索了一下,打开控制台,发现失位的只是选择时间的.ant-picker-panel-container,.ant-picker-range-arrow(小箭头)并没有失位,就想着通过监听面板打开/关闭时的回调(onOpenChange)来解决这个问题,其中本来是想用setInterval,发现用它还是会有问题(第一次先点右边,再点左边,选择框不会跟过去),就用setInterval了。只是个临时解决bug的方案,希望对你们有用咯 image

Seveneeee avatar Jun 10 '23 03:06 Seveneeee

调试后发现v5版本已修复。v4.24.10版本仍存在,原因是点击"结束时间"后rc-picker设置右侧panel的marginLeft时,因未能获取到arrow的offsetWidth,所以panelLeft设置成了0 @afc163 v4版本是否需要修复,需要的话,我提个pr

cooljser avatar Jun 25 '23 09:06 cooljser

欢迎PR

yoyo837 avatar Jun 25 '23 09:06 yoyo837

v4.x版本临时解决方案

.ant-picker-range-arrow {
  display: block!important;
}

cooljser avatar Jun 25 '23 10:06 cooljser

Fixed in https://github.com/ant-design/ant-design/pull/43179

afc163 avatar Jun 27 '23 02:06 afc163