We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 61bf23a commit d0f94d1Copy full SHA for d0f94d1
src/components/Layout/useTocHighlight.tsx
@@ -4,7 +4,7 @@
4
5
import {useState, useRef, useEffect} from 'react';
6
7
-const TOP_OFFSET = 75;
+const TOP_OFFSET = 85;
8
9
export function getHeaderAnchors(): HTMLAnchorElement[] {
10
return Array.prototype.filter.call(
@@ -32,7 +32,7 @@ export function useTocHighlight() {
32
const scrollPosition = window.scrollY + window.innerHeight;
33
const headersAnchors = getHeaderAnchors();
34
35
- if (scrollPosition >= 0 && pageHeight - scrollPosition <= TOP_OFFSET) {
+ if (scrollPosition >= 0 && pageHeight - scrollPosition <= 0) {
36
// Scrolled to bottom of page.
37
setCurrentIndex(headersAnchors.length - 1);
38
return;
0 commit comments