From 217a29e99c701a689273cc426a0544b274cf1ea1 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 30 Mar 2025 06:52:42 -0300 Subject: client: sticky-heading: use reference heading for hit detection Not sure how we missed this!! --- src/static/js/client/sticky-heading.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/static/js/client/sticky-heading.js b/src/static/js/client/sticky-heading.js index 1fa131d6..1020cab3 100644 --- a/src/static/js/client/sticky-heading.js +++ b/src/static/js/client/sticky-heading.js @@ -233,9 +233,10 @@ function getContentHeadingClosestToStickySubheading(index) { // so the used bottom edge should always be *as though* it's only // displaying one line of text. Subtract the current discrepancy. const stickyHeading = info.stickyHeadings[index]; + const referenceCollapsedHeading = info.referenceCollapsedHeading[index]; const correctBottomEdge = stickyHeading.getBoundingClientRect().height - - parseFloat(getComputedStyle(stickyHeading).fontSize); + referenceCollapsedHeading.getBoundingClientRect().height; const stickyBottom = (stickyRect.bottom -- cgit 1.3.0-6-gf8a5