« get me outta code hell

client: sticky-heading: skip invisible headings - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2026-07-19 19:32:32 -0300
committer(quasar) nebula <qznebula@protonmail.com>2026-07-19 19:32:32 -0300
commit7f99962fb03356afae144b7f187a5ce475624604 (patch)
tree5a3c443e8ab14b307288b2371eb0fb636d78f05d
parent6a713867ed1e8353ae6aacddc955ddd84389692d (diff)
client: sticky-heading: skip invisible headings
-rw-r--r--src/static/js/client/sticky-heading.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/static/js/client/sticky-heading.js b/src/static/js/client/sticky-heading.js
index c69e137f..5381a8b7 100644
--- a/src/static/js/client/sticky-heading.js
+++ b/src/static/js/client/sticky-heading.js
@@ -258,6 +258,9 @@ function getContentHeadingClosestToStickySubheading(index) {
       continue;
     }
 
+    if (heading.checkVisibility?.() === false) continue;
+    if (heading.offsetParent === null) continue;
+
     const headingRect = heading.getBoundingClientRect();
     if (headingRect.y + headingRect.height / 1.5 < stickyBottom + 40) {
       return heading;