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
[Bug]: docs-mode table-of-contents does not change URL when clicking on an anchor #26345
Comments
@kroeder in the repro you provided, the TOC does link to the # anchor. Can you clarify how do you expect it to work differently? |
@vanessayuenn yes, it links to the anchor correctly, but clicking it doesn't change the browser URL |
I have confirmed the behavior @kroeder described: When hovering over the anchor tag, as shown in the image below, it behaves as expected. However, upon clicking, the browser URL does not update to reflect the clicked anchor tag. @vanessayuenn Can I give it a try? Thanks. |
@sooster910 of course! We'd be thrilled to have your contribution. If this is your first contribution, be sure to check the contribution guide and hop onto the Storybook Discord if you need any help getting started. Looking forward to your PR! ✨ |
Bug - When toc:true is enabled, docs-mode renders a table-of-contents inside the docs page. Clicking a toc list-item does not change the URL. Solution - Add a function so that the URL changes when clicking on a toc list-item.
Describe the bug
If you enable
toc: true
, docs-mode renders a table-of-contents inside the docs page.When clicking on one of the toc list-items, the expected behavior would be to add the # anchor to the browser URL.
It should behave the same as clicking the # icon on a docs-page headline.
To Reproduce
https://stackblitz.com/edit/github-w91kck?file=.storybook%2Fpreview.ts
System
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: