Javascript window does not disappear?

I have a delete button in react that when clicked, my deleteHandler() is fired and … Read more Javascript window does not disappear?

I have a delete button in react that when clicked, my deleteHandler() is fired and the window comes up however when I try to click outside the window it doesnt disappear?
So the user is forced to refresh the page to cancel the delete functionality.

  const deleteHandler = (id) => {
if (window.alert('Are you sure you want to delete?')) {
  dispatch(deleteCoin(id));
  alert(`Coin of Lot# ${id} deleted successfully.`);
}


};

Source: JavaSript – Stack Overflow


Categories: NewsTags: ,

Leave a Reply

Your email address will not be published. Required fields are marked *