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

232
Visualizações
React-Window with MUI collapsible table rows

I looking for help sorting out problem I encountered recently while working with React-Window and MUI Collapsible Table Rows.

In general react-window render row for each of my item in the array, with some of the content hidden till we press arrow. When pressed, below our column appear new one with hidden content.

 function Row({ index, style }) {
   const [showList, toggleShowList] = useState(false);   
   
   return (
    <Fragment>
      <TableRow sx={style}>
         <TableCell>Visable Row:{index}</TableCell>
         <TableCell>
            <IconButton
                  aria-label="expand row"
                  size="small"
                  onClick={() => toggleShowList(!showList)}
                >
                  {showList ? <KeyboardArrowUpIcon /> : <KeyboardArrowDownIcon />}
            </IconButton>
         </TableCell>
       </TableRow>
       <TableRow sx={{ style, display: showList ? "table-row" : "none" }}>
          <TableCell>hidden row:{index}</TableCell>
       </TableRow>
     </Fragment>
    );
  }

Above example is based on MUI Table component page. Problem arise when I passing it to React-Window as its display hidden content out of place.

I try to using useRef() for calculating Row Height but its has no effect on hidden element.

I open for suggestions and solutions. I created an example on code Sandbox with both how its actually work and how (it should) I want it to work.

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