From f3139fa2173d0b170a24e8aea42328d5ae73103b Mon Sep 17 00:00:00 2001 From: nklhrstv Date: Fri, 23 Oct 2020 14:43:47 +0300 Subject: [PATCH] 50px tolerance added to last section --- src/routes/Settings/Settings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/routes/Settings/Settings.js b/src/routes/Settings/Settings.js index 1539cef02..306e8a5b5 100644 --- a/src/routes/Settings/Settings.js +++ b/src/routes/Settings/Settings.js @@ -99,7 +99,7 @@ const Settings = () => { ]), []); const [selectedSectionId, setSelectedSectionId] = React.useState(GENERAL_SECTION); const updateSelectedSectionId = React.useCallback(() => { - if (sectionsContainerRef.current.scrollTop + sectionsContainerRef.current.clientHeight === sectionsContainerRef.current.scrollHeight) { + if (sectionsContainerRef.current.scrollTop + sectionsContainerRef.current.clientHeight >= sectionsContainerRef.current.scrollHeight - 50) { setSelectedSectionId(sections[sections.length - 1].id); } else { for (let i = sections.length - 1; i >= 0; i--) {