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

129
Visualizações
Changes are made in all selections, instead of the one I choose

Changes are made in all selections, instead of the one I choose. When I check the checkbox in one selection, all the others change. Changing How can I change that? applications should change the name to the name of the marked checkbox in each selected selection. However, it changes in all the selections I have.

const handleSelect = (e,id) => {

let newValue = [1];
if (e.target.value.length) {
  newValue = e.target.value.filter((item) => {
    return item > 1;
  });
}

const finalString = newValue
  .reduce((acumulatedFinal, pass) => {
    return acumulatedFinal + ", " + exportOptionNames[pass - 1];
  }, "")
  .replace(",", "")
  .trim();

setSelectedSelections(finalString.length ? finalString : "Export Option");

setExportOption(newValue);
};






                       <FormControl }>
                    <Select  onClick={(e)=> e.stopPropagation()}
                      labelId="label"
                      id="select"
                      value={exportOption}
                      multiple
                      onChange={(e) => handleSelect (e, item.id)}
                     key={item.id}
                      renderValue={() => {
                        return selectedOptionNames;
                      }}
                      input={<BootstrapInput />}
                    >
                      <MenuItem value={1} disabled>
                        Export Report
                      </MenuItem>
                      <MenuItem value={2}>
                        <Checkbox checked={exportOption.includes(2)} />
                        <ListItemText>{exportOptionNames[1]}</ListItemText>
                      </MenuItem>
                      <MenuItem value={3}>
                        <Checkbox checked={exportOption.includes(3)} />
                        <ListItemText>{exportOptionNames[2]}</ListItemText>
                      </MenuItem>
                      <MenuItem value={4}>
                        <Checkbox checked={exportOption.includes(4)} />
                        <ListItemText>{exportOptionNames[3]}</ListItemText>
                      </MenuItem>
                    </Select>
                    
           
about 4 years ago · Juan Pablo Isaza
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