修复左侧list和右侧甘特视图滚动偏差,行无法对齐问题

This commit is contained in:
qiuchengw
2025-09-25 11:43:05 +08:00
parent 185c6047cc
commit 139b76423f
3 changed files with 7 additions and 8 deletions
+2 -2
View File
@@ -1543,8 +1543,8 @@ onMounted(() => {
const handleTaskListVerticalScroll = (event: CustomEvent) => {
const { scrollTop } = event.detail
const timelineBody = document.querySelector('.timeline-body') as HTMLElement
if (timelineBody && timelineBody.scrollTop !== scrollTop) {
// 避免循环触发,只在scrollTop不同时才设置
if (timelineBody && Math.abs(timelineBody.scrollTop - scrollTop) > 1) {
// 使用更精确的比较,避免1px以内的细微差异导致的循环触发
timelineBody.scrollTop = scrollTop
}
}