fixed scrollspy
This commit is contained in:
1 parent
0add0ab54c
commit
0dbfb473bf
3 files changed
+11
-7
No files matched your search
@@ -181,7 +181,7 @@ fun DocsPage(
|
||||
scheduled = false
|
||||
try {
|
||||
val heads = toc.mapNotNull { id -> el.querySelector("#${id.id}") as? HTMLHeadingElement }
|
||||
val tops = heads.map { it.getBoundingClientRect().top + window.scrollY }
|
||||
val tops = heads.map { it.getBoundingClientRect().top }
|
||||
val offset = (updateNavbarOffsetVar() + 16).toDouble()
|
||||
val idx = activeIndexForTops(tops, offset)
|
||||
setActiveTocId(if (idx in toc.indices) toc[idx].id else null)
|
||||
|
||||
Reference in new issue
Block a user