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

Aberta
#8,047 1 comentário 2 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
1-2 dias
Facilidade para iniciantes
45/100
Tipo de issue
Bug
Clareza
Razoavelmente clara
Status de atividade
Estagnada
Stack de tecnologia
javascript, react
Domínio
frontend, web-dev

Direção de pesquisa

Reproduza o problema na página de documentação do React vinculada, rolando lentamente no Android Chrome ou no macOS Firefox; em seguida, inspecione o comportamento quando os títulos entram no viewport. Está concluído quando a rolagem não cria entradas fantasmas no histórico e o botão Voltar do navegador retorna à página anterior ao ser pressionado pela primeira vez.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

bug: unconfirmed
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.

Linguagem predominante
JavaScript
Estrelas
11.8k
Forks
7.9k
Merge médio
16h 6min
PRs com merge (30d)
7

Guia de contribuição

Abrir o guia de contribuição

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de reactjs/react.dev

Todas as issues de reactjs/react.dev

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.