Prevent page reload when clicking on the action

This commit is contained in:
Arnaud 2024-08-22 17:12:03 +02:00
parent 9b805d362c
commit ff80a518ed
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663
1 changed files with 8 additions and 1 deletions

View File

@ -4,7 +4,14 @@ export const ActionCellRender =
(action: string, onClick: (row: string[]) => void) => (action: string, onClick: (row: string[]) => void) =>
(_: string, row: string[]) => { (_: string, row: string[]) => {
return ( return (
<a href="#" onClick={() => onClick(row)} className="cell--action"> <a
href="#"
onClick={(e) => {
e.preventDefault();
onClick(row);
}}
className="cell--action"
>
<SimpleText variant="primary" bold={true}> <SimpleText variant="primary" bold={true}>
{action} {action}
</SimpleText> </SimpleText>