Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

Row selection acting strange when using fully controlled table

Aberta
#4,812 4 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

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

Direção de pesquisa

Comece com a reprodução mínima no CodeSandbox, especialmente em src/main.tsx por volta das linhas 667-702, e reproduza o problema na segunda, terceira ou quarta página. Inspecione getToggleAllPageRowsSelectedHandler e o comportamento da paginação controlada. Está concluído quando a seleção do cabeçalho seleciona a página exibida atualmente em vez da primeira página.

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

Descrição

Describe the bug

When I try to use table row selection with fully controlled state and i'm on the second page, then it selects the first page.

I think it's either the selection function is not accounting for the page index in getToggleAllPageRowsSelectedHandler OR it is re-rendering the page index back to 0.

Your minimal, reproducible example

https://codesandbox.io/s/tanstack-table-fullycontrolled-w-selection-gmuhmm?file=/src/main.tsx:667-702

Steps to reproduce
  1. Go to second, third, or fourth page of table
  2. Click the header selection
  3. See that something did get selected.
  4. Go back to first page and see the first page gets selected.
Expected behavior

As a user I expect to see the page that im on get selected when using the header selection.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

mac OS, chrome, Version 112.0.5615.49 (Official Build) (arm64)

react-table version

8.8.5

TypeScript version

No response

Additional context

No response

Terms & Code of Conduct
  • I agree to follow this project's Code of Conduct
  • I understand that if my bug cannot be reliable reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.
Linguagem predominante
TypeScript
Estrelas
28.5k
Forks
3.6k
Merge médio
1d 5h
PRs com merge (30d)
20

Preparar o ambiente

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 TanStack/table

Todas as issues de TanStack/table

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

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