-
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
feature: CalendarPicker组件无法自动滚动到选中日期 #6425
Labels
Comments
暂时可以这样: useEffect(() => {
if (visible) {
const el = document.getElementById(dayjs(saveDate).format('YYYY-MM-DD'))
setTimeout(() => {
el?.scrollIntoView({ behavior: 'smooth', block: 'center' })
}, 100)
}
}, [visible])
<CalendarPicker
renderDate={(date) => {
return <div id={dayjs(date).format('YYYY-MM-DD')}>{date.getDate()}</div>
}}
/> |
牛的,完美解决问题 |
当设置了min 且min 与现在日期相差较大时,默认在min页,然后el 可能为空,就无法跳转过去了 |
改造了一下
|
6 6 6 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version of antd-mobile
No response
What is this feature about?
希望日历组件能自动滚动到当前选中日期
The text was updated successfully, but these errors were encountered: