react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

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

Open jar-presta-onepoint opened this issue 10 months ago • 1 comments

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

jar-presta-onepoint avatar Mar 19 '25 10:03 jar-presta-onepoint

It actually works on Google Chrome, but not on Firefox

jar-presta-onepoint avatar Mar 20 '25 08:03 jar-presta-onepoint