Open
Description
Summary:
When an element in a modal calls stopPropagation
on the click event, it seems the first click on the overlay does not close the modal.
Steps to reproduce:
- Create a modal with
onRequestClose
- Add a click handler to any element in the modal
- Call
stopPropagation
on the click event object - Click on the overlay
Expected behavior:
The modal should close on the first click on the overlay.
Link to example of issue:
https://codepen.io/marcselman/pen/eYWrNML
Additional notes:
I'm using stopPropagation
because I have some nested elements in the modal with multiple event handlers and I sometimes don't want the click event to bubble down to a lower element.