Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

191
Visualizações
Unchecked checkbox value when filter the item

<!-- begin snippet: js hide: false console: true babel: false -->

{allKanban.filter(item => {
                      if (searchKanban === ""){
                        return item;
                      } else if (item.kanbanNumber.toLowerCase().includes(searchKanban.toLowerCase())) {
                        return item;
                      }
                    })
                    .map((item, i) => {
                        return (
                          <TableRow key={i}>
                            <TableCell align="center" {...register(`selectedKanbanList.${i}.kanbanId`, { value: item.kanbanId })} >{item.kanbanNumber}</TableCell>
                            <TableCell align="center">
                              <Checkbox align="center" value={item.kanbanNumber} defaultChecked={item.isUsing} {...register(`selectedKanbanList.${i}.kanbanNumber`)} />
                            </TableCell>
                          </TableRow>
                        )
                      })}

As above mention code Trying to searchKanban in the list that time selected default checked value remove and showing unchecked value. How can I search items without removing the already selected checked value in the checkbox?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

I suspect things will begin to work if you use ${item.kanbanId} instead of ${i} in the lines with register. You probably want to wire things up to a specific element in the array and not the element's position within the array. The position will change when you filter items out.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda