Parsec
Parsec
Explore posts from servers
KPCKevin Powell - Community
Created by Parsec on 6/30/2023 in #front-end
Overlay catches click when clicking the modal
So, I have an overlay with a Modal in the center of the screen. Inside is an input element that has a custom datalist beneath it. All behaves normal. When I click anything in the modal nothing odd happens and the clicks are correctly registered as the item being clicked on (e.target is logical). The modal is a child of the Overlay. When one or more items are added in the datalist, even without adding any additional event handlers, it makes clicks inside the modal register as if the overlay was clicked (e.target === e.currentTarget). I'm out of options since I cannot distinguish anymore what is actually clicked. Even adding a click handler on the Modal with 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. Any ideas as to what else I can try?
13 replies