From 14ebbda585d4a3fa0cf2c71219da79104ed02930 Mon Sep 17 00:00:00 2001 From: Yuyao Huang Date: Sat, 9 May 2026 15:29:01 +0800 Subject: [PATCH] fix: skip save during initial handleScrollFocus call Wrap the initial handleScrollFocus call with isInitializing flag to prevent handleScrollSave from incorrectly updating selected_task_id --- static/js/tasks.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/static/js/tasks.js b/static/js/tasks.js index 8a6dc25..e795ccc 100644 --- a/static/js/tasks.js +++ b/static/js/tasks.js @@ -162,8 +162,10 @@ function initScrollFocus() { scrollView.addEventListener("scroll", handleScrollFocus); 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(); + isInitializing = false; } function handleScrollFocus() {