<MaterialTable
onRowClick={() => openRightDrawer()}
actions={[
{
icon:"Check",
tooltip:"Activate",
onClick: () => activateAccount()
}
]}
components={{
Action: props => <Button onClick={() => props.action.onClick()}>Activate</Button>
}}
/>
当我单击按钮时,onRowClick事件也会触发,对此有什么解决方法吗?
谢谢@mbrn,让它工作起来了https://github.com/mbrn/material-table/issues/1362
<MaterialTable
onRowClick={() => openRightDrawer()}
actions={[
{
icon:"Check",
tooltip:"Activate",
onClick: () => activateAccount()
}
]}
components={{
Action: props => <Button onClick={(event) => {
props.action.onClick();
event.stopPropagation();
}
}>Activate</Button>
}}
/>