chore: fix modal positioning when using themed desktop titlebar
This commit is contained in:
@@ -128,7 +128,7 @@ async function configureWindow(remoteBridge: CrossProcessBridge) {
|
||||
/* Use custom title bar. Take the sn-titlebar-height off of
|
||||
the app content height so its not overflowing */
|
||||
sheet.insertRule(
|
||||
'[role="dialog"] { position: relative; height: calc(100vh - var(--sn-desktop-titlebar-height)) !important; margin-top: var(--sn-desktop-titlebar-height) !important; }',
|
||||
'[role="dialog"] { height: calc(100vh - var(--sn-desktop-titlebar-height)) !important; top: var(--sn-desktop-titlebar-height); }',
|
||||
sheet.cssRules.length,
|
||||
)
|
||||
sheet.insertRule(
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user