diff options
| 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 |
| commit | 7f99962fb03356afae144b7f187a5ce475624604 (patch) | |
| tree | 5a3c443e8ab14b307288b2371eb0fb636d78f05d /src/static/js/client | |
| parent | 6a713867ed1e8353ae6aacddc955ddd84389692d (diff) | |
client: sticky-heading: skip invisible headings
Diffstat (limited to 'src/static/js/client')
| -rw-r--r-- | src/static/js/client/sticky-heading.js | 3 |
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; |