mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-23 19:48:54 +02:00
feat(theme-classic): autoscroll TOC with active link (#6317)
* feat(theme-common): add smooth TOC scrolling to active link * docs: change the link of repeated content category in lifecycle api * Update lifecycle-apis.md * fix page container scrolling Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
02a233a221
commit
2f97a85406
1 changed files with 1 additions and 0 deletions
|
@ -144,6 +144,7 @@ function useTOCHighlight(config: TOCHighlightConfig | undefined): void {
|
|||
}
|
||||
link.classList.add(linkActiveClassName);
|
||||
lastActiveLinkRef.current = link;
|
||||
link.scrollIntoView({block: 'nearest'});
|
||||
} else {
|
||||
link.classList.remove(linkActiveClassName);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue