docusaurus
docusaurus copied to clipboard
Table of contents should scroll with content
Have you read the Contributing Guidelines on issues?
- [X] I have read the Contributing Guidelines on issues.
Prerequisites
- [X] I'm using the latest version of Docusaurus.
- [ ] I have tried the
npm run clearoryarn clearcommand. - [ ] I have tried
rm -rf node_modules yarn.lock package-lock.jsonand re-installing packages. - [ ] I have tried creating a repro with https://new.docusaurus.io.
- [ ] I have read the console error message carefully (if applicable).
Description
When there's a big page with tons of sections, the "table of contents" sidebar does not really keep up with the user.
For example, here I have scrolled into the table.reverse section, but in the TOC sidebar, it is hardly visible:
If I were to scroll further, the active section would be completely past the viewport on the sidebar.
Reproducible demo
https://pluto-lang.org/docs/Runtime%20Environment/Global%20Reference
Steps to reproduce
Big page.
Expected behavior
The TOC sidebar scrolls with me.
Actual behavior
It does not.
Your environment
- Public source code: https://github.com/PlutoLang/plutolang.github.io
- Public site URL: https://pluto-lang.org/docs/Runtime%20Environment/Global%20Reference
- Docusaurus version used: 3.1.1
- Environment name and version (e.g. Chrome 89, Node.js 16.4): Chrome 122.0.6261.70. Probably Node 22 since that's what GH actions should be using.
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 10
Self-service
- [ ] I'd be willing to fix this bug myself.
our students from https://labs.codeday.org will be taking a shot at this issue in the coming week :) (they'll be making their first contributions to break into the world of open source)
Please see https://github.com/facebook/docusaurus/issues/6058 and https://github.com/facebook/docusaurus/issues/6587. It is not an easy feature to implement and none of the maintainers are interested in taking over the work of a novice when we ourselves have no good solutions.
oh my apologies, thanks for the heads up, do you know any issues on this repo that would be better suited for novices?
It would vary a lot by what your "novices" are equipped with and what they are enthusiastic to learn about. Most of the tech and coding style would be new to them. Pick any issue that doesn't seem to involve a lot of internal details and see if they understand what should be changed.
I think #9781 would work better, leaving a comment there
I'm a bit confused, shouldn't this "feature" already be implemented given that #6317 was merged? Is this not a regression?
I'm a bit confused, shouldn't this "feature" already be implemented given that #6317 was merged? Is this not a regression?
It seems there was an issue with the PR that implemented this feature so the change were reverted until the bug is fixed
https://github.com/facebook/docusaurus/pull/6317#issuecomment-1048944752