Skip to content

Commit

Permalink
Only handle onclick in the button instead of stopping propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
ideskov committed May 24, 2020
1 parent 1874dc4 commit 1879caa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions app/src/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ function AddItemForm({ onNewItem }) {
function ItemDisplay({ item, onItemUpdate, onItemRemoval }) {
const { Container, Row, Col, Button } = ReactBootstrap;

const toggleCompletion = (event) => {
event.stopPropagation()
const toggleCompletion = () => {
fetch(`/items/${item.id}`, {
method: 'PUT',
body: JSON.stringify({
Expand Down Expand Up @@ -153,7 +152,6 @@ function ItemDisplay({ item, onItemUpdate, onItemRemoval }) {
}
>
<i
onClick={toggleCompletion}
className={`far ${
item.completed ? 'fa-check-square' : 'fa-square'
}`}
Expand Down

0 comments on commit 1879caa

Please sign in to comment.