Skip to content

Commit

Permalink
fix(anchor): active anchor error (#47795)
Browse files Browse the repository at this point in the history
  • Loading branch information
winchesHe committed Mar 11, 2024
1 parent f8532c1 commit 3818c10
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/anchor/Anchor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ const Anchor: React.FC<AnchorProps> = (props) => {
const target = document.getElementById(sharpLinkMatch[1]);
if (target) {
const top = getOffsetTop(target, container);
if (top < _offsetTop + _bounds) {
if (top <= _offsetTop + _bounds) {
linkSections.push({ link, top });
}
}
Expand Down

0 comments on commit 3818c10

Please sign in to comment.