diff --git a/static/js/tasks.js b/static/js/tasks.js index e795ccc..cee2a85 100644 --- a/static/js/tasks.js +++ b/static/js/tasks.js @@ -159,13 +159,13 @@ function initScrollFocus() { scrollView.removeEventListener("scroll", handleScrollFocus); scrollView.removeEventListener("scroll", handleScrollSave); + + // Initial call to set in-focus class (before binding scroll handler) + handleScrollFocus(); + + // Bind scroll handlers after initial setup scrollView.addEventListener("scroll", handleScrollFocus); scrollView.addEventListener("scroll", handleScrollSave); - - // Initial call to set in-focus class (skip saving during init) - isInitializing = true; - handleScrollFocus(); - isInitializing = false; } function handleScrollFocus() {