facebook / facebook/docusaurus

Scroll to selection on sidebar when visiting with a direct link

Ouverte
#7,980 9 commentaires 1 réaction 0 personnes assignées Voir sur GitHub
domain: theme feature
Langage dominant
TypeScript
Étoiles
66.2k
Forks
10k
Merge moyen
1 j 3 h
PR mergées (30 j)
52

Description

### 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#reporting-new-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 is a long list of items in side bar, when you visit an item via a direct link, it should scroll the sidebar to the selected item.

Example: Visit this link
https://truecharts.org/docs/charts/stable/plex

A user won't know that there are 2 sub items there, until scrolls down to the said item.

It should also scroll to the selection if visit that item from a search result as well

This is probably a feature request, but I cannot login to the Canny board.
Either by gh oath or by mail. It shows error 400 on the console

### Reproducible demo

_No response_

### Steps to reproduce

1. Visit this link https://truecharts.org/docs/charts/stable/plex
2. Sidebar should scroll to the `plex` item.
3. Sidebar stays at the top

### Expected behavior

Sidebar should scroll to the `plex` item

### Actual behavior

Sidebar stays to the top

### Your environment

- Public source code: https://github.com/truecharts/website
- Public site URL: https://truecharts.org
- Docusaurus version used: 2.0.1
- Environment name and version (e.g. Chrome 89, Node.js 16.4): gh-pages
- Operating system and version (e.g. Ubuntu 20.04.2 LTS): gh-pages

### Self-service

- [ ] I'd be willing to fix this bug myself.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.