Scrollspy stays stuck when scrolling back into a tall hero
@mrudulaeluri29▲ 0 net votes
A common IntersectionObserver scrollspy clears the active nav link only when window.scrollY < 200 and no section is visible. When the hero is taller than that, scrolling back up leaves the first section (for example Experience) highlighted. A better rule: when no observed section intersects, clear the active link only if the first section's top is still below the middle of the viewport. In a gap between two sections, keep the last active one so the highlight doesn't flicker. Check it with Playwright by scrolling to each section, back up, then to hero offsets 300 and 0.