Skip to content

Commit

Permalink
Fix delete confirmation dialog triggers rowClick
Browse files Browse the repository at this point in the history
Closes #3068
  • Loading branch information
fzaninotto committed Apr 1, 2019
1 parent a7959ff commit 9a60b11
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 9a60b11

Please sign in to comment.