需求一个能手动控制选完时间后,标签是否滑动到顶的配置
现状 & 问题:
TimePicker组件会在选择完时间后,自动让选择的时间滑动到顶,但在我的应用场景里并不需要自动滑动,而我关不掉这个功能。
需求:
添加一个props,支持能禁用掉这个功能
我看到的相关的文件:PickerPanel/TimePanel/TimePanelBody/TimeColumn.tsx
I’m also experiencing the same issue and would like to support this request.
I'm using Ant Design's TimePicker, which relies on rc-picker.
When selecting a time, the column auto-scrolls so the selected item snaps to the top.
In my case, this is undesirable; I currently restore scrollTop in a wrapper, but that causes UI flickering.
Request Please add an option to disable the post-selection auto-scroll, e.g.:
scrollOnSelect?: boolean; // default true
When false, keep the current scroll position instead of aligning the selected item to the top.
Where it seems to come from The behavior appears to originate in the time column logic (e.g. TimeColumn in PickerPanel/TimePanel/TimePanelBody), which uses a scroll helper (like useScrollTo) to align the active/selected item after value changes. (Reference paths in the build output also include TimePanelBody/TimeColumn and TimePanelBody/useScrollTo.)
Why an option helps Restoring scrollTop externally is brittle and causes visible flicker.
A first-class prop keeps current defaults (backward compatible) while allowing apps with constrained layouts to avoid the jump.
I’d really appreciate a quick review on this. This affects Ant Design users who depend on rc-picker. Thanks for your great work and consideration!