reactjs / reactjs/react.dev

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

Abierto
#8,047 1 comentario 2 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

bug: unconfirmed
Lenguaje dominante
JavaScript
Estrellas
11.8k
Forks
7.9k
Merge medio
1 d 11 h
PR fusionados (30 d)
11

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Reproduce el problema en la página de documentación de React enlazada desplazándote lentamente en Android Chrome o macOS Firefox; después, inspecciona el comportamiento cuando los encabezados entran en el viewport. Se considera terminado cuando el desplazamiento no crea entradas fantasma en el historial y el botón Atrás del navegador vuelve a la página anterior con la primera pulsación.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
javascript, react
Área
frontend, web-dev
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
45/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.