Add detailed scroll position diagnostics
This commit is contained in:
parent
0f1fa712a9
commit
025195be27
@ -167,9 +167,17 @@ function scrollToTask(taskId) {
|
|||||||
const scrollViewHeight = scrollView.clientHeight;
|
const scrollViewHeight = scrollView.clientHeight;
|
||||||
const taskHeight = taskElement.offsetHeight;
|
const taskHeight = taskElement.offsetHeight;
|
||||||
const targetScrollTop = taskTop - (scrollViewHeight / 2) + (taskHeight / 2);
|
const targetScrollTop = taskTop - (scrollViewHeight / 2) + (taskHeight / 2);
|
||||||
console.log("Scrolling to:", targetScrollTop, "element offsetTop:", taskTop);
|
console.log("scrollViewHeight:", scrollViewHeight, "taskHeight:", taskHeight);
|
||||||
|
console.log("taskTop:", taskTop, "targetScrollTop:", targetScrollTop);
|
||||||
scrollView.scrollTop = targetScrollTop;
|
scrollView.scrollTop = targetScrollTop;
|
||||||
console.log("scrollTop after set:", scrollView.scrollTop);
|
console.log("scrollTop set to:", scrollView.scrollTop);
|
||||||
|
|
||||||
|
// Check all task positions
|
||||||
|
const allTasks = scrollView.querySelectorAll('.task-item');
|
||||||
|
console.log("All task positions:");
|
||||||
|
allTasks.forEach((t, i) => {
|
||||||
|
console.log(` Task ${t.dataset.taskId}: offsetTop=${t.offsetTop}, visible=${t.offsetTop >= targetScrollTop && t.offsetTop < targetScrollTop + scrollViewHeight}`);
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log("Task element not found for id:", taskId);
|
console.log("Task element not found for id:", taskId);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user