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

fix sidebar highlighting when links share path but not hash #2625

Closed
wants to merge 3 commits into from
Closed

fix sidebar highlighting when links share path but not hash #2625

wants to merge 3 commits into from

Conversation

garrett-hopper
Copy link
Contributor

Fixes an issue where many items in the sidebar are highlighted at the same time. (Shared pathname, different hashes)

Less than ideal because it uses a page refresh to rebuild the sidebar
Perhaps it could instead add current to the active link and also somehow find the old link to remove current from?
Feel free to modify as you see fit.

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jul 5, 2024

I am very confused by this... could you share a docs site where this happens? The left navigation which this updates only includes individual pages, not hashes within the page.

@garrett-hopper
Copy link
Contributor Author

garrett-hopper commented Jul 5, 2024

image

Turns out this is caused by a double re-export. The two references are what get highlighted incorrectly.

index.ts

export * as test from './test'
export * from './test'

test/index.ts

export const test1 = 1
export const test2 = 1

@Gerrit0
Copy link
Collaborator

Gerrit0 commented Jul 10, 2024

Ah, I see! The re-exports shouldn't be showing up in the left hand page's navigation at all.

@Gerrit0 Gerrit0 closed this in dae2527 Jul 10, 2024
@garrett-hopper
Copy link
Contributor Author

Thanks! 😁

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