Skip to content

Commit

Permalink
Merge pull request #3080 from marmelab/fix-confirm-event-propagation
Browse files Browse the repository at this point in the history
[RFR] Fix delete confirmation dialog triggers rowClick
  • Loading branch information
Gildas Garcia authored Apr 2, 2019
2 parents 1332ea9 + 9a60b11 commit e8de36a
Showing 1 changed file with 22 additions and 20 deletions.
42 changes: 22 additions & 20 deletions packages/ra-ui-materialui/src/layout/Confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,28 @@ import classnames from 'classnames';
import compose from 'recompose/compose';
import { translate } from 'ra-core';

const styles = theme => createStyles({
contentText: {
minWidth: 400,
},
confirmPrimary: {
color: theme.palette.primary.main,
},
confirmWarning: {
color: theme.palette.error.main,
'&:hover': {
backgroundColor: fade(theme.palette.error.main, 0.12),
// Reset on mouse devices
'@media (hover: none)': {
backgroundColor: 'transparent',
const styles = theme =>
createStyles({
contentText: {
minWidth: 400,
},
confirmPrimary: {
color: theme.palette.primary.main,
},
confirmWarning: {
color: theme.palette.error.main,
'&:hover': {
backgroundColor: fade(theme.palette.error.main, 0.12),
// Reset on mouse devices
'@media (hover: none)': {
backgroundColor: 'transparent',
},
},
},
},
iconPaddingStyle: {
paddingRight: '0.5em',
},
});
iconPaddingStyle: {
paddingRight: '0.5em',
},
});

/**
* Confirmation dialog
Expand All @@ -54,7 +55,8 @@ const styles = theme => createStyles({
class Confirm extends Component {
state = { loading: false };

handleConfirm = () => {
handleConfirm = e => {
e.stopPropagation();
this.setState({ loading: true });
this.props.onConfirm();
};
Expand Down

0 comments on commit e8de36a

Please sign in to comment.