Merge branch 'main' into brett/RND-2311-openapi-enum

This commit is contained in:
Brett Jephson
2024-09-25 09:17:21 +01:00
committed by GitHub
2 changed files with 9 additions and 1 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'gitbook': patch
---
Include offset in calculations of whether scrollable element is in view
@@ -66,5 +66,8 @@ function isOutOfView(tocItem: HTMLElement, tocContainer: HTMLElement) {
const tocItemTop = tocItem.offsetTop;
const containerTop = tocContainer.scrollTop;
const containerBottom = containerTop + tocContainer.clientHeight;
return tocItemTop < containerTop || tocItemTop > containerBottom;
return (
tocItemTop < containerTop + TOC_ITEM_OFFSET ||
tocItemTop > containerBottom - TOC_ITEM_OFFSET
);
}