1
0
Fork 0
mirror of synced 2024-09-02 10:41:09 +12:00

Revert clickoutside

This commit is contained in:
Andrew Kingston 2024-04-02 11:01:50 +01:00
parent 2e4e3eac60
commit d71766b9a4

View file

@ -1,4 +1,8 @@
const ignoredClasses = [".flatpickr-calendar", ".download-js-link"]
const ignoredClasses = [
".flatpickr-calendar",
".spectrum-Popover",
".download-js-link",
]
let clickHandlers = []
/**
@ -21,13 +25,6 @@ const handleClick = event => {
return
}
// Ignore clicks for popovers, unless the handler is registered from one
const sourceInPopover = handler.anchor.closest(".spectrum-Popover") != null
const clickInPopover = event.target.closest(".spectrum-Popover") != null
if (clickInPopover && !sourceInPopover) {
return
}
// Ignore clicks for modals, unless the handler is registered from one
const sourceInModal = handler.anchor.closest(".spectrum-Underlay") != null
const clickInModal = event.target.closest(".spectrum-Underlay") != null