I have a cell renderer that returns the name property and objects on a row:
const nameRenderer = ({ value, data }) => {
const { id: queueId } = data;
return (
<Box>
<div className="row-hidden-menu">
<IconButton
icon="menu"
onClick={({ event }) => {
event.preventDefault();
event.stopPropagation();
onMenuClick();
}}
/>
</div>
</Box>
);
};
The issue I have is that I have an onRowClick
function but I don't want that function to be called when I click the icon from the nameRenderer
. Right now when the menu opens, the onRowClicked
event navigates to a new page.
stopPropagation()
will stop the event from bubbling up whilepreventDefault()
will only surpress the default behavior of the event. The code provided in the question is in the right direction but it doesn't work because of a React design quirk. – Sapwood