<MaterialTable
onRowClick={() => openRightDrawer()}
actions={[
{
icon:"Check",
tooltip:"Activate",
onClick: () => activateAccount()
}
]}
components={{
Action: props => <Button onClick={() => props.action.onClick()}>Activate</Button>
}}
/>
当我单击按钮时,onRowClick事件也会触发此问题的解决方法吗?
答案 0 :(得分:0)
感谢@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>
}}
/>