onClick preventDefault/stopPropagation not working

I have an solid-ag-grid based table with buttons in the table. I tried everything but clicking the button always triggers the onRowClicked too 🙁
<IconButton onClick={(event) => {
event.preventDefault();
event.stopPropagation();

console.log("Edit tapped on row", props.data, event);

return false
}}>
<IconButton onClick={(event) => {
event.preventDefault();
event.stopPropagation();

console.log("Edit tapped on row", props.data, event);

return false
}}>
1 Reply
Bersaelor
BersaelorOP23h ago
Ok, seems this fixes it:
onRowClicked={(row) => {
if (row.event?.defaultPrevented) {
return null;
}
handleRowClick(row);
}}
onRowClicked={(row) => {
if (row.event?.defaultPrevented) {
return null;
}
handleRowClick(row);
}}

Did you find this page helpful?