fix(admin): handle click if specified #1257

This commit is contained in:
Johann Pinson 2018-05-24 16:04:00 +02:00
parent 0a9fff5a30
commit 6ddafb4fe3
2 changed files with 6 additions and 4 deletions

View File

@ -16,9 +16,11 @@ function Ico(props) {
}
const handleClick = (e, onClick) => {
e.preventDefault();
e.stopPropagation();
onClick(e);
if (onClick) {
e.preventDefault();
e.stopPropagation();
onClick(e);
}
};
Ico.propTypes = {

View File

@ -82,7 +82,7 @@ class TableRow extends React.Component {
cells.push(
<td key='action' className={styles.actions}>
<IcoContainer icons={[{ icoType: 'pencil' }, { id: this.props.record.id, icoType: 'trash', onClick: this.props.onDelete }]} />
<IcoContainer icons={[{ icoType: 'pencil', onClick: false }, { id: this.props.record.id, icoType: 'trash', onClick: this.props.onDelete }]} />
</td>
);