<MaterialTable
onRowClick={() => openRightDrawer()}
actions={[
{
icon:"Check",
tooltip:"Activate",
onClick: () => activateAccount()
}
]}
components={{
Action: props => <Button onClick={() => props.action.onClick()}>Activate</Button>
}}
/>当我单击一个按钮时,onRowClick事件也会触发,有什么解决方法吗?
发布于 2019-11-21 15:07:15
谢谢@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>
}}
/>https://stackoverflow.com/questions/58960615
复制相似问题