Skip to content

Commit 2c61677

Browse files
rgrvlskRogerjuliusmarminge
authored
fix(web): overlays close on a click over the desktop header (#36250)
Co-authored-by: Roger <[email protected]> Co-authored-by: Julius Marminge <[email protected]>
1 parent 9803d1a commit 2c61677

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

‎apps/web/src/components/ui/command.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function CommandDialogViewport({ className, ...props }: CommandDialogPrimitive.V
4545
return (
4646
<CommandDialogPrimitive.Viewport
4747
className={cn(
48-
"pointer-events-none fixed inset-0 z-50 flex flex-col items-center px-4 pt-[max(--spacing(4),4vh,calc(var(--command-titlebar-height)+--spacing(2)))] pb-[max(--spacing(4),4vh)] sm:pt-[max(10vh,calc(var(--command-titlebar-height)+--spacing(2)))] sm:pb-[10vh]",
48+
"pointer-events-none fixed inset-0 z-50 flex flex-col items-center px-4 [-webkit-app-region:no-drag] pt-[max(--spacing(4),4vh,calc(var(--command-titlebar-height)+--spacing(2)))] pb-[max(--spacing(4),4vh)] sm:pt-[max(10vh,calc(var(--command-titlebar-height)+--spacing(2)))] sm:pb-[10vh]",
4949
className,
5050
)}
5151
data-slot="command-dialog-viewport"

‎apps/web/src/components/ui/dialog.tsx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ function DialogBackdrop({
8686
function DialogViewport({ className, ...props }: DialogPrimitive.Viewport.Props) {
8787
return (
8888
<DialogPrimitive.Viewport
89+
// Electron drag regions ignore z-index, so without no-drag a click over a header drag strip never reaches the page.
8990
className={cn(
90-
"fixed inset-0 z-50 grid grid-rows-[1fr_auto_1fr] justify-items-center p-4",
91+
"fixed inset-0 z-50 grid grid-rows-[1fr_auto_1fr] justify-items-center p-4 [-webkit-app-region:no-drag]",
9192
className,
9293
)}
9394
data-slot="dialog-viewport"
@@ -146,7 +147,7 @@ function DialogPopup({
146147
className={cn(
147148
bottomStickOnMobile && "max-sm:grid-rows-[1fr_auto] max-sm:p-0 max-sm:pt-12",
148149
variant === "media" &&
149-
"z-[60] grid-rows-1 place-items-center px-4 pb-6 pt-[calc(var(--native-titlebar-height,0px)+1.5rem)] [-webkit-app-region:no-drag]",
150+
"z-[60] grid-rows-1 place-items-center px-4 pb-6 pt-[calc(var(--native-titlebar-height,0px)+1.5rem)]",
150151
)}
151152
>
152153
{popup}

‎apps/web/src/components/ui/sheet.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function SheetViewport({
4040
return (
4141
<SheetPrimitive.Viewport
4242
className={cn(
43-
"fixed inset-0 z-(--z-sheet) grid",
43+
"fixed inset-0 z-(--z-sheet) grid [-webkit-app-region:no-drag]",
4444
side === "bottom" && "grid grid-rows-[1fr_auto] pt-12",
4545
side === "top" && "grid grid-rows-[auto_1fr] pb-12",
4646
side === "left" && "flex justify-start",

0 commit comments

Comments
 (0)