-
Notifications
You must be signed in to change notification settings - Fork 2.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
CalendarPicker为什么只能向后滚动, 不能向前滚动 #6412
Comments
给个 codesandbox 看看? |
嗯, |
@zombieJ 还有就是抽屉出现时,默认在min处,而不是当前选中项,如果我的min设置到一年前,我每次都需要手动去滚动 |
@zombieJ 是的这里确实是个bug |
+1,默认打开的时候没有滚动到当前选中的位置在使用上感觉挺不友好的 |
这个bug还没有修复吗 |
@angleneo @cheng-xiaofeng @liqiuqiui 你们在使用的时候,会期望这个组件可以无限滚动么?现在其实是限制了 6 个月的选择。 |
至少可以增加个自定义的可选时间范围
ly
***@***.***
…------------------ 原始邮件 ------------------
发件人: "ant-design/ant-design-mobile" ***@***.***>;
发送时间: 2024年1月15日(星期一) 中午11:18
***@***.***>;
***@***.******@***.***>;
主题: Re: [ant-design/ant-design-mobile] CalendarPicker为什么只能向后滚动, 不能向前滚动 (Issue #6412)
@angleneo @cheng-xiaofeng @liqiuqiui 你们在使用的时候,会期望这个组件可以无限滚动么?现在其实是限制了 6 个月的选择。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
This comment was marked as outdated.
This comment was marked as outdated.
|
同样的有这个困扰。如果设置了min,每次打开这个picker显示的是min所在的日期。 |
期望默认无限滚动,可配制 min、max,而且期望首次打开的时候,如果没有传入 value、defaultValue,则默认展示当前月,而非展示 min 所在月 🙏🙏🙏 |
监听日期选择框,手动滚动到对应默认选中的日期未知 // 控制日期选择
const [visibleCalendarPicker, setVisibleCalendarPicker] = useState(false)
useEffect(() => {
if (visibleCalendarPicker) {
const timeout = setTimeout(() => {
const elementCalendar = document.querySelector<HTMLDivElement>('.adm-calendar-picker-view-body');
const element = document.querySelector<HTMLDivElement>('.adm-calendar-picker-view-cell-selected-begin');
if (elementCalendar && element) {
elementCalendar.scrollTop = element.offsetTop - 200;
}
}, 100);
return () => clearTimeout(timeout);
}
}, [visibleCalendarPicker]); |
Version of antd-mobile
5.33.0
What is this feature about?
比如现在是2023年10月, 我用ref?.current?.jumpTo({ year: 2023, month: 11 })跳到了11月份, 我想滚动到10月份, 但没法回到10月份
The text was updated successfully, but these errors were encountered: