Skip to content

Commit 99a825c

Browse files
fix: ensure integer value for rootMarginBottom (#13059)
Co-authored-by: sentry-autofix[bot] <157164994+sentry-autofix[bot]@users.noreply.github.com>
1 parent 91c228a commit 99a825c

File tree

1 file changed

+2
-1
lines changed
  • src/components/sidebarTableOfContents

1 file changed

+2
-1
lines changed

src/components/sidebarTableOfContents/index.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ export function SidebarTableOfContents() {
115115
// account for the header height
116116
const rootMarginTop = 100;
117117
// element is consiered in view if it is in the top 1/3 of the screen
118-
const rootMarginBottom = (2 / 3) * window.innerHeight - rootMarginTop;
118+
const rootMarginBottomRaw = (2 / 3) * window.innerHeight - rootMarginTop;
119+
const rootMarginBottom = Math.floor(rootMarginBottomRaw);
119120
const observerOptions = {
120121
rootMargin: `${rootMarginTop}px 0px -${rootMarginBottom}px 0px`,
121122
threshold: 1,

0 commit comments

Comments
 (0)