fix: can't detect that the page has scrolled to the bottom (#956) (#970)

pull/974/head
fi3ework 2 years ago committed by GitHub
parent 7a9e4d9ee0
commit 98e45af127
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -105,7 +105,7 @@ export function useActiveAnchor(
const scrollY = window.scrollY const scrollY = window.scrollY
const innerHeight = window.innerHeight const innerHeight = window.innerHeight
const offsetHeight = document.body.offsetHeight const offsetHeight = document.body.offsetHeight
const isBottom = scrollY + innerHeight === offsetHeight const isBottom = Math.abs(scrollY + innerHeight - offsetHeight) < 1
// page bottom - highlight last one // page bottom - highlight last one
if (anchors.length && isBottom) { if (anchors.length && isBottom) {

Loading…
Cancel
Save