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

toc active item highlight #122

Merged
merged 1 commit into from
Sep 19, 2023
Merged

toc active item highlight #122

merged 1 commit into from
Sep 19, 2023

Conversation

jakubabrzy
Copy link
Collaborator

In this PR we changed variable of nav header to improve scroll functionality which highlights item after the click on right sidebar navigation. Previously it calculated it wrong because docusarious thinks that our sticky nav has 24px (even it isn't visible) so either we can set --ifm-navbar-height variable to 24px to improve it or set this property hideOnScroll to true. I have choosen second option as it could have smaller impact on rest of behaviours in the app which base on --ifm-navbar-height

closes #109

@Roma36
Copy link
Collaborator

Roma36 commented Sep 19, 2023

@jakubabrzy I can confirm that it behaves well in most cases, but there's still one case where it feels buggy - when you click on the last item in TOC.
On screenshot, I've clicked the last item but the one before last got highlighted. Maybe it's related to the fact that both items fit on the screen. Could you please take a look at this?
https://6cf67d9d.opentf-website.pages.dev/docs/cli/init/#reinitializing-only-modules

Screenshot 2023-09-19 at 10 24 01

@jakubabrzy
Copy link
Collaborator Author

jakubabrzy commented Sep 19, 2023

@Roma36 It looks like another docusarius issue - it is associated with scroll behavioour when we see more than one section at the bottom on the screen. If you go to https://docusaurus.io/docs/search#using-your-own-search and remove footer from html to see more than one section it will be also broken.

@jakubabrzy jakubabrzy merged commit 8f6b7d3 into main Sep 19, 2023
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.

TOC active item bug
3 participants