Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scrollspy is not always working #244

Open
zipymonkey opened this issue Feb 11, 2025 · 3 comments · Fixed by #245
Open

Scrollspy is not always working #244

zipymonkey opened this issue Feb 11, 2025 · 3 comments · Fixed by #245
Assignees
Labels
bug Something isn't working

Comments

@zipymonkey
Copy link
Collaborator

On smaller screens sometimes the publication table of content item is not marked as active.

Steps to Duplicate

@zipymonkey zipymonkey added enhancement New feature or request bug Something isn't working and removed enhancement New feature or request labels Feb 11, 2025
@zipymonkey
Copy link
Collaborator Author

This seem to be mostly publications (maybe because there are a lot of those?)

@zipymonkey zipymonkey self-assigned this Feb 12, 2025
@zipymonkey
Copy link
Collaborator Author

The bootstrap scrollspy functionality uses the IntersectionObserver to control when to add the.active class so we could tweak the rootMargin to adjust when the intersection happens.

This also might be related resizing but I don't think so.

zipymonkey added a commit that referenced this issue Feb 12, 2025
…s-working

Issue #244 - Changing the rootMargin offset to -48px top/bottom.
@zipymonkey
Copy link
Collaborator Author

The PR is an improvement but not a fix. "This occurs when sections aren't large enough to take up the display space, so when a few sections are all on the page at the same time ScrollSpy defaults to the last section." We'd probably need to write a custom solution for the but I am not 100% sure the best method for this.

  • Move id to the header (but this might be an issue with long sections)
  • Reduce the interaction box size (can we do that?)
  • Replace with scroll eventListener (less performant and very custom).
  • Other?

Leaving this open for now to potentially revisit if we can enough feedback on this.

@zipymonkey zipymonkey reopened this Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant