Skip to content

Commit

Permalink
fix(tableIcon): fix tap icon when onPress is undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianoforlenza authored and navarroaxel committed Mar 16, 2018
1 parent 9fcf255 commit c18e4a2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Table/TableIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const TableIcon = ({column, datum}) => (
isFunction(column.icon) ? column.icon(datum) : column.icon,
isFunction(column.color) ? column.color(datum) : column.color
)}
onPress={() => column.onPress(datum)}
onPress={isFunction(column.onPress) ? (() => column.onPress(datum)) : undefined}
/>
);

Expand Down
1 change: 1 addition & 0 deletions src/Table/columnPropType.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default PropTypes.shape({
id: PropTypes.number.isRequired,
label: PropTypes.string.isRequired,
field: PropTypes.string.isRequired,
onPress: PropTypes.func,
showValue: PropTypes.func,
hideValue: PropTypes.func,
componentClass: PropTypes.oneOfType([
Expand Down

0 comments on commit c18e4a2

Please sign in to comment.