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
|
/* Use custom title bar. Take the sn-titlebar-height off of
|
||||||
the app content height so its not overflowing */
|
the app content height so its not overflowing */
|
||||||
sheet.insertRule(
|
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.cssRules.length,
|
||||||
)
|
)
|
||||||
sheet.insertRule(
|
sheet.insertRule(
|
||||||
|
|||||||
@@ -27,11 +27,13 @@ export const usePopoverCloseOnClickOutside = ({
|
|||||||
const isDescendantOfChildPopover = closestPopoverId && childPopovers.has(closestPopoverId)
|
const isDescendantOfChildPopover = closestPopoverId && childPopovers.has(closestPopoverId)
|
||||||
const isPopoverInModal = popoverElement?.closest('[data-dialog], .sk-modal')
|
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], .sk-modal')
|
||||||
|
const isDescendantOfDesktopTitlebar = !!target.closest('#desktop-title-bar')
|
||||||
|
|
||||||
if (
|
if (
|
||||||
!isDescendantOfMenu &&
|
!isDescendantOfMenu &&
|
||||||
!isAnchorElement &&
|
!isAnchorElement &&
|
||||||
!isDescendantOfChildPopover &&
|
!isDescendantOfChildPopover &&
|
||||||
|
!isDescendantOfDesktopTitlebar &&
|
||||||
(!isDescendantOfModal || (isDescendantOfModal && hideOnClickInModal))
|
(!isDescendantOfModal || (isDescendantOfModal && hideOnClickInModal))
|
||||||
) {
|
) {
|
||||||
if (!disabled) {
|
if (!disabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user