fix: skip save during initial handleScrollFocus call

Wrap the initial handleScrollFocus call with isInitializing flag
to prevent handleScrollSave from incorrectly updating selected_task_id
This commit is contained in:
Yuyao Huang 2026-05-09 15:29:01 +08:00
parent fd92c6fe96
commit 14ebbda585

View File

@ -162,8 +162,10 @@ function initScrollFocus() {
scrollView.addEventListener("scroll", handleScrollFocus); scrollView.addEventListener("scroll", handleScrollFocus);
scrollView.addEventListener("scroll", handleScrollSave); scrollView.addEventListener("scroll", handleScrollSave);
// Initial call to set in-focus class // Initial call to set in-focus class (skip saving during init)
isInitializing = true;
handleScrollFocus(); handleScrollFocus();
isInitializing = false;
} }
function handleScrollFocus() { function handleScrollFocus() {