Skip to content

Conversation

@kimyvgy
Copy link
Owner

@kimyvgy kimyvgy commented Jul 6, 2024

What does it do?

This will solve the issue #29.

  • Remove the active state if no section matches
  • Do not trigger the onActive hook for the menu item that is already in the active state
  • Remove window.load, auto-call onScroll() instead

After fix

simple-scrollspy-2024-07-06_15.36.14.mp4

sulliops and others added 3 commits June 26, 2024 19:54
Modified behavior of getSectionInView(), onScroll(), and removeCurrentActive() to remove active class on first menu item when that item corresponds to a section below other content
Fix #29 remove active class on first item in nav, when scrolled back up
- Remove the active state if no section matches
- Do not trigger the `onActive` hook for the menu item that is already in the active state
- Remove window.load, auto-call onScroll() instead
@kimyvgy kimyvgy marked this pull request as ready for review July 6, 2024 08:45
@kimyvgy kimyvgy merged commit 896661d into master Jul 6, 2024
@kimyvgy kimyvgy deleted the fix/active-status branch July 6, 2024 08:49
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