chore: fix modal positioning when using themed desktop titlebar

This commit is contained in:
Aman Harwara
2023-07-05 20:43:55 +05:30
parent d4db3e055c
commit 2611c88cee
2 changed files with 3 additions and 1 deletions

View File

@@ -27,11 +27,13 @@ export const usePopoverCloseOnClickOutside = ({
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 isDescendantOfDesktopTitlebar = !!target.closest('#desktop-title-bar')
if (
!isDescendantOfMenu &&
!isAnchorElement &&
!isDescendantOfChildPopover &&
!isDescendantOfDesktopTitlebar &&
(!isDescendantOfModal || (isDescendantOfModal && hideOnClickInModal))
) {
if (!disabled) {