mirror of
https://github.com/strapi/strapi.git
synced 2025-09-27 09:25:46 +00:00
fix(admin): handle click if specified #1257
This commit is contained in:
parent
0a9fff5a30
commit
6ddafb4fe3
@ -16,9 +16,11 @@ function Ico(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleClick = (e, onClick) => {
|
const handleClick = (e, onClick) => {
|
||||||
e.preventDefault();
|
if (onClick) {
|
||||||
e.stopPropagation();
|
e.preventDefault();
|
||||||
onClick(e);
|
e.stopPropagation();
|
||||||
|
onClick(e);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Ico.propTypes = {
|
Ico.propTypes = {
|
||||||
|
@ -82,7 +82,7 @@ class TableRow extends React.Component {
|
|||||||
|
|
||||||
cells.push(
|
cells.push(
|
||||||
<td key='action' className={styles.actions}>
|
<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>
|
</td>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user