How to stop row expanding when clicking a component inside a cell?

I want the row to expand when I click the row however I don't want it to expand when clicking an element. For example clicking this component for a menu, expands the row - but I want it to only expand when I click the row itself not the components inside the cells.
Anyway to do this?
@AshCorah for your last column, did you use formatter to custom the content, right?
I think so far I can not control it but I will figure out if there's some way can achieve your requirement, thanks
btw, there's a expandRow.expandByColumnOnly option, you can disable it when you only want to user to expand on clicking the expand columns. But I think this is not fit your request at all lol
The other solution is you can call e.stoppropagation() when clicking on your component.
const Pricer = ({ cell }) => {
const onClick = e => e.stopPropagation();
return (
<span onClick={ onClick }>
<strong style={ { color: 'red' } }>$ { cell } NTD(Sales!!)</strong>
</span>
);
};
function priceFormatter(cell) {
return (
<Pricer cell={ cell } />
);
}
const columns = [{
dataField: 'id',
text: 'Product ID'
}, {
dataField: 'name',
text: 'Product Name'
}, {
dataField: 'price',
text: 'Product Price',
formatter: priceFormatter
}];
Let me know if above solutions are not work for you, thanks
This worked for me, thanks so much :)
👍
This really helps, Thanks !!
In June 2022 I have the same issue, it works now. You saved my day, thank you !