Made a table containing some fetched data with a button to open a menu on the right end of the rows. Made every row clickable to get redirected to a render where you can edit the current entry. However making the rows clickable(adding the link to the <tr>
) covers the "Menu" button as they are rendered on the rows as well.
Is there a way to avoid this, meaning still having the row clickable but the button rendered with each entry wont be affected?
<thead>
<tr>
<th>#</th>
<th>TestData</th>
<th>TestData</th>
<th>TestData</th>
<th>TestData</th>
<th>TestData</th>
<th>TestData</th>
<th>TestData</th>
<th>TestData</th>
<th></th>
</tr>
</thead>
<tbody>
{tableValues && tableValues.map((tableValue, index) => (
<tr key={index} className="hover:cursor-pointer" onClick={() => handleRowClick(tableValue.id)}>
<td>{index + 1}</td>
<td>{tableValue.TestData}</td>
<td>{tableValue.dispatch && dayjs.unix(tableValue.dispatch.seconds).format('DD/MM/YY')}</td>
<td>{tableValue.TestData}</td>
<td>{tableValue.TestData}</td>
<td>{tableValue.TestData}</td>
<td>{tableValue.TestData}</td>
<td>{tableValue.TestData}</td>
<td>{tableValue.TestData}</td>
<td>
<Menu shadow="md" width={200}>
<Menu.Target>
<UnstyledButton>
<IconDotsVertical>Toggle menu</IconDotsVertical>
</UnstyledButton>
</Menu.Target>
</Menu>
</tbody>
Example of a row in the table, dots on the right is the button https://i.stack.imgur.com/5WTfJ.png