facebook / facebook/docusaurus

Table of contents should scroll with content

Abierto
#9,904 7 comentarios 1 reacción 0 asignados Ver en GitHub
difficulty: advanced domain: theme feature
Lenguaje dominante
TypeScript
Estrellas
66.2k
Forks
10k
Merge medio
1 d 3 h
PR fusionados (30 d)
52

Descripción

### Have you read the Contributing Guidelines on issues?

- [X] I have read the [Contributing Guidelines on issues](https://github.com/facebook/docusaurus/blob/main/CONTRIBUTING.md#issues).

### Prerequisites

- [X] I'm using the latest version of Docusaurus.
- [ ] I have tried the `npm run clear` or `yarn clear` command.
- [ ] I have tried `rm -rf node_modules yarn.lock package-lock.json` and 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:

![image](https://github.com/facebook/docusaurus/assets/63328889/3a58d5fc-8848-4e2f-8637-e06119f7f54e)

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.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.