mirror of
https://github.com/Stremio/stremio-web.git
synced 2026-01-11 22:40:31 +00:00
Added small tolerance of 10px, fixes #1078
This commit is contained in:
parent
9cbfd15793
commit
6aef6e1d04
1 changed files with 2 additions and 1 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue