fix: ensure scroll position is restored before initializing scroll focus
Move initScrollFocus() after scrollToTask() to prevent handleScrollFocus() from incorrectly updating selected_task_id before the saved position is restored
This commit is contained in:
parent
b69065e487
commit
f021395773
@ -42,7 +42,6 @@ async function loadTasks() {
|
||||
|
||||
renderTasks();
|
||||
initSortable();
|
||||
initScrollFocus();
|
||||
|
||||
const currentGoal = goals.find(g => g.id === selectedGoalId);
|
||||
const savedTaskId = currentGoal ? currentGoal.selected_task_id : null;
|
||||
@ -64,6 +63,8 @@ async function loadTasks() {
|
||||
selectTask(tasks[0].id);
|
||||
}
|
||||
}
|
||||
|
||||
initScrollFocus();
|
||||
} catch (error) {
|
||||
console.error("Failed to load tasks:", error);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user