Move modal consideration CSS selector up a few levels to underlay to prevent modal close clicks triggering external handlers

This commit is contained in:
Andrew Kingston 2023-05-05 09:18:00 +01:00
parent e01e91e075
commit 5b0ba593b8
1 changed files with 2 additions and 2 deletions

View File

@ -26,8 +26,8 @@ const handleClick = event => {
} }
// Ignore clicks for modals, unless the handler is registered from a modal // Ignore clicks for modals, unless the handler is registered from a modal
const sourceInModal = handler.anchor.closest(".spectrum-Modal") != null const sourceInModal = handler.anchor.closest(".spectrum-Underlay") != null
const clickInModal = event.target.closest(".spectrum-Modal") != null const clickInModal = event.target.closest(".spectrum-Underlay") != null
if (clickInModal && !sourceInModal) { if (clickInModal && !sourceInModal) {
return return
} }