Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

190
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda