From d810e0c0f3ec5a3602d886c128646ae9056a60c0 Mon Sep 17 00:00:00 2001 From: "Antoine Vandevenne (anv)" Date: Fri, 19 Feb 2021 17:52:04 +0100 Subject: [PATCH] fix page toc scroll issue --- extensions/odoo_theme/static/js/page_toc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/odoo_theme/static/js/page_toc.js b/extensions/odoo_theme/static/js/page_toc.js index cf947906b..82a3fe610 100644 --- a/extensions/odoo_theme/static/js/page_toc.js +++ b/extensions/odoo_theme/static/js/page_toc.js @@ -102,10 +102,10 @@ }); let timeoutId = undefined; document.addEventListener('scroll', () => { + clearTimeout(timeoutId); // For each scroll event, cancel the previous timeout callback timeoutId = setTimeout(() => { clickedHeadingRef = undefined; // Go back to highlighting the heading ref in view }, 100); - clearTimeout(timeoutId); // For each scroll event, cancel the previous timeout callback _updateFlags(); });