reactjs / reactjs/react.dev

[Bug]: Browser back button not working as expected after scrolling down the page

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

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

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

説明

Summary

After slowly scrolling all the way down a page like https://react.dev/learn/separating-events-from-effects, I have to hit the browser back button several times before I'm actually taken to the previous page in my history.

Page

https://react.dev/learn/separating-events-from-effects

Details

I've often noticed that once I've read to the bottom of a page in the React docs, I have to hit my browser's back button several times before I'm actually taken to the previous page in my browser history. I've noticed this at least on Android Chrome and macOS Firefox.

As I scroll down a page like https://react.dev/learn/separating-events-from-effects, certain elements seem to create "phantom" browser-history entries when they enter the viewport. Here is a video grab demonstrating what I mean:

https://github.com/user-attachments/assets/f67aba96-52f7-4f4c-a744-1122bdf3e91a

In this clip, at first there are no previous browser-history entries available to go back to (the back button is dimmed). However, once the "Extracting non-reactive logic out of Effects" heading comes into view, an entry is created. If I start at the top of the page and scroll all the way to the bottom (slowly), I have to hit the back button four times before the browser navigates to my previous page; the first three times, nothing appears to happen at all.

This may or may not be related to #8021 and/or #787.

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

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

はじめの一歩

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

調査の方向性

リンクされたReactドキュメントページで、Android ChromeまたはmacOS Firefoxを使ってゆっくりスクロールして問題を再現し、見出しがviewportに入ったときの挙動を確認します。スクロールによって履歴に不要なエントリが作成されず、ブラウザの戻るボタンを1回押すだけで前のページに戻れば完了です。

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

評価

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

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

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