chore: dont auto-close popover when closing modal

This commit is contained in:
Aman Harwara
2023-08-14 11:52:57 +05:30
parent ea8f9dba03
commit 2775d5e161

View File

@@ -26,7 +26,9 @@ export const usePopoverCloseOnClickOutside = ({
const closestPopoverId = target.closest('[data-popover]')?.getAttribute('data-popover')
const isDescendantOfChildPopover = closestPopoverId && childPopovers.has(closestPopoverId)
const isPopoverInModal = popoverElement?.closest('[data-dialog], .sk-modal')
const isDescendantOfModal = isPopoverInModal ? false : !!target.closest('[data-dialog], .sk-modal')
const isDescendantOfModal = isPopoverInModal
? false
: !!target.closest('[data-dialog], [data-backdrop], .sk-modal')
const isDescendantOfDesktopTitlebar = !!target.closest('#desktop-title-bar')
if (