Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

82
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!