e.target is logical). The modal is a child of the Overlay.e.target === e.currentTarget). I'm out of options since I cannot distinguish anymore what is actually clicked.e.stopPropagation() doesn't help, because it doesn't register as the modal being clicked at all. I've tried Z-index as well. This bevior is the same in FireFox and Safari.