点击今天后微调滚动:补偿sticky月份分隔条遮挡,首行日期完整显示;版本号升至1.5.9
This commit is contained in:
2 files changed
+10
-1
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ops_vue_js",
|
||||
"version": "1.5.8",
|
||||
"version": "1.5.9",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"engines": {
|
||||
|
||||
@@ -858,8 +858,17 @@ function applyTodayScroll() {
|
||||
}
|
||||
if (targetEl && targetEl.classList.contains('week-row')) {
|
||||
targetEl.scrollIntoView({ block: 'start' })
|
||||
adjustForStickySeparator(container, targetEl)
|
||||
} else {
|
||||
todayCell.scrollIntoView({ block: 'start' })
|
||||
adjustForStickySeparator(container, todayWeekEl)
|
||||
}
|
||||
}
|
||||
|
||||
function adjustForStickySeparator(container, weekEl) {
|
||||
const sep = weekEl?.previousElementSibling
|
||||
if (sep?.classList.contains('month-separator')) {
|
||||
container.scrollBy({ top: -sep.getBoundingClientRect().height })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user