Skip to content

Commit

Permalink
Merge pull request #2686 from plattdl/master
Browse files Browse the repository at this point in the history
Fix EditButton in Datagrids using rowClick
  • Loading branch information
fzaninotto authored Dec 26, 2018
2 parents c87915b + 7b5689b commit 079f792
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/ra-ui-materialui/src/button/EditButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { linkToRecord } from 'ra-core';

import Button from './Button';

// useful to prevent click bubbling in a datagrid with rowClick
const stopPropagation = e => e.stopPropagation();

const EditButton = ({
basePath = '',
label = 'ra.action.edit',
Expand All @@ -18,6 +21,7 @@ const EditButton = ({
component={Link}
to={linkToRecord(basePath, record.id)}
label={label}
onClick={stopPropagation}
{...rest}
>
{icon}
Expand Down

0 comments on commit 079f792

Please sign in to comment.