« get me outta code hell

client: sticky-heading: use reference heading for hit detection - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2025-03-30 06:52:42 -0300
committer(quasar) nebula <qznebula@protonmail.com>2025-03-30 06:53:36 -0300
commit217a29e99c701a689273cc426a0544b274cf1ea1 (patch)
tree516d782ac8cac0edd4b745b365b482e6203de298 /src
parent71e9b2ef7dcdf1072faeb38270e4597400c2f6ee (diff)
client: sticky-heading: use reference heading for hit detection
Not sure how we missed this!!
Diffstat (limited to 'src')
-rw-r--r--src/static/js/client/sticky-heading.js3
1 files changed, 2 insertions, 1 deletions
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