Fix #2628, #2531: Improve Docsify Router & Scroll Behavior for H1–H6 by KashviYadav09 · Pull Request #2668 · docsifyjs/docsify · GitHub
Skip to content

Fix #2628, #2531: Improve Docsify Router & Scroll Behavior for H1–H6#2668

Open
KashviYadav09 wants to merge 1 commit into
docsifyjs:developfrom
KashviYadav09:fix-history-push
Open

Fix #2628, #2531: Improve Docsify Router & Scroll Behavior for H1–H6#2668
KashviYadav09 wants to merge 1 commit into
docsifyjs:developfrom
KashviYadav09:fix-history-push

Conversation

@KashviYadav09

Copy link
Copy Markdown

This PR addresses multiple navigation and scrolling issues in Docsify:

Auto-scroll for H6 headings (#2628):

Ensures smooth scrolling works correctly for all headings, including H6, by updating the scroll logic in render.js.

Prevent unnecessary history push (#2531):

Avoids redundant history.pushState calls when clicking a link pointing to the same page or hash.

Reduces browser history clutter and improves user experience.

Smooth scroll enhancement (additional improvement):

Ensures all headings (H1–H6) are scrolled smoothly into view using scrollIntoView({ behavior: "smooth" }).

Supports dynamic content loaded at runtime.

@vercel

vercel Bot commented Jan 19, 2026

Copy link
Copy Markdown

Comment thread README.md
Comment on lines +84 to +107

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

No need to add these.

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.

2 participants