reactjs / reactjs/react.dev

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

オープン
#7,686 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug: unconfirmed
主要言語
JavaScript
スター
11.8k
フォーク
7.9k
平均マージ
1日 11時間
マージ済み PR(30日)
11

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

リンク先の react.dev/reference/react/useCallback ページから始め、初回ナビゲーション時に「Deep Dive」セクションがどのようにレンダリングされ、開かれるかを調べます。新しいページの読み込みで指定されたテキストフラグメント URL を再現し、その後、セクションを読み込んで開いた後にフラグメントを追加した場合と比較します。直接ナビゲーションしたときに、ブラウザーが折りたたまれた「Deep Dive」セクション内のテキストまでスクロールし、そのテキストをハイライトすれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, react
領域
documentation, web-dev
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
48/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。