From 7bf954d09ad6ce80a353418f188e8694f51f89be Mon Sep 17 00:00:00 2001 From: fi3ework Date: Tue, 12 Jul 2022 16:10:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20can=E2=80=99t=20detect=20that=20the=20pa?= =?UTF-8?q?ge=20has=20scrolled=20to=20the=20bottom=20(fix=20#956)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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) {