RowClick上的材质表和actions按钮单击重叠


<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>
}}
/>

相关内容

  • 没有找到相关文章

最新更新