Skip to content

Comments

Fix: sidebar active state not updating while scrolling#148

Closed
sahillllllllll-bit wants to merge 2 commits intom-lab:mainfrom
sahillllllllll-bit:fix-scroll
Closed

Fix: sidebar active state not updating while scrolling#148
sahillllllllll-bit wants to merge 2 commits intom-lab:mainfrom
sahillllllllll-bit:fix-scroll

Conversation

@sahillllllllll-bit
Copy link

This PR fixes an issue where the sidebar navigation active state was not updating correctly while scrolling between sections.

The original implementation relied solely on Scrollex, which in some cases did not trigger consistently depending on browser behavior and layout rendering.

Changes

  • Adjusted scrollex trigger configuration (mode: top, improved viewport offsets)
  • Added a scroll-based fallback handler using offset() for reliable section detection
  • Preserved existing active-locked logic to avoid breaking click behavior

Why This Fix Is Needed:

The previous implementation required a manual click before the active state updated correctly. This created inconsistent navigation highlighting and degraded UX.

The fallback ensures correct behavior across browsers and device

before

Screen.Recording.2026-02-20.150701.mp4

after

Screen.Recording.2026-02-20.150727.mp4

@sahillllllllll-bit
Copy link
Author

@robertodauria I’ve pushed a fix for the sidebar scroll active state - please review and let me know if any changes are needed.

@robertodauria
Copy link
Contributor

Thanks for the contribution. Closing this as it is superseded by #83, which rewrites the codebase removing Angular, jQuery, Gulp, and the old app/ directory structure. The files modified by this PR either no longer exist after that change or the change has already been made.

We aim to merge #83 next week, which will give contributors a stable, modern base to work from. We'd encourage you to review #83 and open any future PRs on top of that.

Additionally, this is likely a duplicate of #85.

@Saurav4359
Copy link

Thanks for the clarification @robertodauria . I’m also reviewing the changes in PR #83 and planning to open future contributions based on the new code structure once it's merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants