Only handle onclick in the button instead of stopping propagation
This commit is contained in:
parent
1874dc4724
commit
1879caaa00
@ -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({
|
||||
@ -153,7 +152,6 @@ function ItemDisplay({ item, onItemUpdate, onItemRemoval }) {
|
||||
}
|
||||
>
|
||||
<i
|
||||
onClick={toggleCompletion}
|
||||
className={`far ${
|
||||
item.completed ? 'fa-check-square' : 'fa-square'
|
||||
}`}
|
||||
|
Loading…
Reference in New Issue
Block a user