From 98e45af127a11bfff3577fe5675788e5479f9d79 Mon Sep 17 00:00:00 2001 From: fi3ework Date: Tue, 12 Jul 2022 16:58:02 +0800 Subject: [PATCH] fix: can't detect that the page has scrolled to the bottom (#956) (#970) --- src/client/theme-default/composables/outline.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/theme-default/composables/outline.ts b/src/client/theme-default/composables/outline.ts index 698aeda63879..355e9bc40b53 100644 --- a/src/client/theme-default/composables/outline.ts +++ b/src/client/theme-default/composables/outline.ts @@ -105,7 +105,7 @@ export function useActiveAnchor( const scrollY = window.scrollY const innerHeight = window.innerHeight const offsetHeight = document.body.offsetHeight - const isBottom = scrollY + innerHeight === offsetHeight + const isBottom = Math.abs(scrollY + innerHeight - offsetHeight) < 1 // page bottom - highlight last one if (anchors.length && isBottom) {