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

83
Visualizações
How to add onClick trigger to an IconButton inside the TableCell

I'm a newbie with MaterialUI therefore apologies if the question is too simple to solve. I'm pulling some data, showing on a table, with an additional column that has a button attached:

<TableCell>
    {<IconButton> <ClearIcon /> </IconButton>}
</TableCell>

I want to add an onClick trigger to the IconButton. However, because the IconButton is nested inside the TableCell the trigger is not reachable. Simply because TableCell is overlapping the button.

When I add onClick to TableCell it works, however it is not a best practice. Thus, when the user clicks around the button it still triggers the onClick.

Any suggestion on how to overcome this issue? I also share the overlap view of TableCell in real time.

Table Cell HTML over IconButton

about 4 years ago · Santiago Gelvez
1 Respostas
Responde à pergunta

0

I think you can add an onClick on the IconButton and then create a function to trigger it, I give you a code example you can try.

<TableCell>
    <IconButton onClick={() => deleteData()}>
       <ClearIcon />
    </IconButton>
</TableCell>

about 4 years ago · Santiago Gelvez 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