From 6aef6e1d04a8988f97956479fda872987e6f6b13 Mon Sep 17 00:00:00 2001 From: Sagar Prasad Chaulagain Date: Mon, 1 Dec 2025 13:13:55 +0545 Subject: [PATCH] Added small tolerance of 10px, fixes #1078 --- src/routes/Settings/Settings.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/routes/Settings/Settings.tsx b/src/routes/Settings/Settings.tsx index d7ab68a3c..be992fda1 100644 --- a/src/routes/Settings/Settings.tsx +++ b/src/routes/Settings/Settings.tsx @@ -41,8 +41,9 @@ const Settings = () => { if (container!.scrollTop + container!.clientHeight >= container!.scrollHeight - 50) { setSelectedSectionId(sections[sections.length - 1].id); } else { + const tolerance = 10; for (let i = sections.length - 1; i >= 0; i--) { - if (sections[i].ref.current && sections[i].ref.current!.offsetTop - container!.offsetTop <= container!.scrollTop) { + if (sections[i].ref.current && sections[i].ref.current!.offsetTop - container!.offsetTop - tolerance <= container!.scrollTop) { setSelectedSectionId(sections[i].id); break; }