Skip to content

fix: handle hash navigation to prevent duplicate callbacks #2575

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

Merged
merged 1 commit into from
Jul 24, 2025

Conversation

sy-records
Copy link
Member

Summary

This PR improves hash navigation handling by correctly setting the navigating flag even when the clicked link points to the current hash.

Related issue, if any:

Close #522

What kind of change does this PR introduce?

Bugfix

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed

Does this PR introduce a breaking change?

No

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge

Copy link

vercel bot commented Jul 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docsify-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2025 9:18am

Copy link
Member

@Koooooo-7 Koooooo-7 left a comment

Choose a reason for hiding this comment

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

LGTM.
Other class/elements which we don't wanna trigger the action in future, we could add them later.

@paulhibbitts paulhibbitts self-requested a review July 23, 2025 14:29
Copy link
Collaborator

@paulhibbitts paulhibbitts left a comment

Choose a reason for hiding this comment

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

From a UX perspective I tested the following and the page scrolled to the expected area:

  1. Visit the Themes section on the PR Preview site
  2. Click any section link (Ex: Classes)
  3. Scroll the page
  4. Click the same section link

Great to see this long-standing issue fixed🎉

@sy-records sy-records merged commit 72569de into docsifyjs:develop Jul 24, 2025
8 checks passed
@sy-records sy-records deleted the fix/522 branch July 24, 2025 03:00
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.

Always scroll to clicked sidebar content
3 participants