[Bug]: Browser back button not working as expected after scrolling down the page
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 11.8k
- Forks
- 7.9k
- Ø Merge
- 1 T. 11 Std.
- Gemergte PRs (30 T.)
- 11
Beschreibung
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.
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere das Problem auf der verlinkten React-Dokumentationsseite, indem du in Android Chrome oder macOS Firefox langsam scrollst, und untersuche anschließend das Verhalten, wenn Überschriften in den Viewport gelangen. Erledigt ist die Aufgabe, wenn das Scrollen keine Phantom-History-Einträge erzeugt und die Zurück-Schaltfläche des Browsers beim ersten Drücken zur vorherigen Seite zurückkehrt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, react
- Bereich
- frontend, web-dev
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100