|
@@ -1,5 +1,5 @@
|
|
import cx from 'classnames';
|
|
import cx from 'classnames';
|
|
-import React, { MouseEventHandler } from 'react';
|
|
|
|
|
|
+import React, { MouseEvent } from 'react';
|
|
import styles from './calorieRow.css';
|
|
import styles from './calorieRow.css';
|
|
|
|
|
|
type CalorieRowProps = {
|
|
type CalorieRowProps = {
|
|
@@ -15,7 +15,10 @@ function CalorieRow (props: CalorieRowProps) {
|
|
onRowClick = Function.prototype
|
|
onRowClick = Function.prototype
|
|
} = props;
|
|
} = props;
|
|
|
|
|
|
- const onClick = () => onRowClick(item);
|
|
|
|
|
|
+ const onClick = (event: MouseEvent) => {
|
|
|
|
+ event.stopPropagation();
|
|
|
|
+ onRowClick(item);
|
|
|
|
+ };
|
|
|
|
|
|
return (
|
|
return (
|
|
<div className={cx(styles.calorieRow, {[styles.selected]: isSelected})} {...{onClick}}>
|
|
<div className={cx(styles.calorieRow, {[styles.selected]: isSelected})} {...{onClick}}>
|