reactjs / reactjs/react.dev

[Bug]: URI Text Fragments do not work with "Deep Dive" text blocks

Aperta
#7,686 1 commento 1 reazione 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug: unconfirmed
Lingua principale
JavaScript
Stelle
11.8k
Fork
7.9k
Merge medio
1g 11h
PR unite (30g)
11

Descrizione

Summary

Clicking a doc link that includes a Text Fragment does not scroll nor highlight the relevant text, if that text happens to be inside a "Deep Dive" section.

Page

https://react.dev/reference/react/useCallback#:~:text=Caching%20a%20function%20with,in%20other%20cases

Details

When attempting to quote a part of the doc that is under a "Deep Dive" section, with a URI text fragment: clicking the link will open the documentation page in the browser, but without scrolling to the relevant block nor highlighting the quoted part of the documentation.

However, there are two cases the highlighting works. Both of those require the page to already be loaded, the fragment is added to the uri of the page:

  • If the section is not opened beforehand: the browser still does not scrolls to the section nor open it, but the text is correctly highlighted.
  • If the section is opened beforehand: the browser scrolls to the section and highlights the text as expected

Here's a video capture of the problem:

https://github.com/user-attachments/assets/989e0a8c-2729-4072-aeca-ded2ac7d5c72

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Parti dalla pagina collegata react.dev/reference/react/useCallback e verifica come la sezione "Deep Dive" viene renderizzata e aperta durante la navigazione iniziale. Riproduci l'URL del frammento di testo fornita in un nuovo caricamento della pagina, quindi confrontala con l'aggiunta del frammento dopo il caricamento e l'apertura della sezione. Il lavoro è completato quando, durante la navigazione diretta, il browser scorre fino al testo all'interno di una sezione "Deep Dive" compressa e lo evidenzia.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
javascript, react
Ambito
documentation, web-dev
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
48/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.