Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/assets/js/kb-header-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,24 @@ class KBHeader {
parent.classList.remove('child-is-fixed');
document.body.classList.remove('header-is-fixed');
}
// Fix stale placeholder height and position when back at top.
//
// Two timing issues cause the header to overlap page content at scrollY=0:
// 1. elHeight (line ~486) is measured before the shrink block (line ~571)
// restores the header row, so placeholderWrapper gets the shrunk value.
// 2. isSticking (used at line ~597) reflects the previous scroll frame,
// so position:fixed persists even though setStickyChanged(false) runs
// afterwards.
//
// Re-measuring and resetting here — after both shrink and class logic
// have completed — corrects both issues in a single pass.
if ( window.scrollY === 0 && this.shrinkMain && ( ! isTransparent || hasStickySection ) ) { this.stickyWrapper.style.position = 'initial';
this.stickyWrapper.style.width = 'initial';
this.stickyWrapper.style.left = 'initial';
this.stickyWrapper.style.top = 'initial';

this.placeholderWrapper.style.height = this.stickyWrapper.offsetHeight + 'px';
}
}

activeSizeCased(size) {
Expand Down