Skip to content

doc: inject sidebar active link scroll into view script #59007

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

btea
Copy link
Contributor

@btea btea commented Jul 9, 2025

When searching for the API in the Quick Flower Cutting module, each time you switch to a different module, the content in the sidebar scrolls to the top, and the currently active link is not immediately visible.

@nodejs-github-bot
Copy link
Collaborator

Review requested:

  • @nodejs/nodejs-website

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Jul 9, 2025
@btea btea changed the title docs: inject sidebar active link scroll into view script doc: inject sidebar active link scroll into view script Jul 9, 2025
Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't add JavaScript unless it's absolutely needed.

If it is, this should added to the assets, rather than directly to the HTML

@btea btea force-pushed the docs/inject-scrollintoview-script branch from a257f95 to defccdf Compare July 9, 2025 14:53
@btea
Copy link
Contributor Author

btea commented Jul 9, 2025

We shouldn't add JavaScript unless it's absolutely needed.

If it is, this should added to the assets, rather than directly to the HTML

Thanks for the tip, it would be nice to add automatic scrolling of active sidebar links into the view area.

Copy link
Member

@avivkeller avivkeller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please lint, fix the casing, and add comments

@btea btea force-pushed the docs/inject-scrollintoview-script branch from 08d3e30 to 09348d4 Compare July 10, 2025 00:07
@btea
Copy link
Contributor Author

btea commented Jul 10, 2025

Done.

Copy link
Member

@mikeesto mikeesto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI, CI is failing because the first commit starts with fix, it should be doc

@btea btea force-pushed the docs/inject-scrollintoview-script branch from 09348d4 to 6643d19 Compare July 12, 2025 04:05
@btea
Copy link
Contributor Author

btea commented Jul 12, 2025

I have modified the commit information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants