Skip to content

Commit

Permalink
fix(dialog): 修复弹出对话框时无法移动窗口的问题 (#277)
Browse files Browse the repository at this point in the history
## 问题原因
对话框的遮蔽层盖过了模拟标题栏

## 解决办法
将遮蔽层设置为可拖拽窗口部分

感谢群友:诶嘿

![image](https://github.com/user-attachments/assets/4a90450b-1ecd-41d2-bf92-36800e2f5ad2)
  • Loading branch information
Littlefean authored Jan 26, 2025
2 parents 2ee4349 + a25289b commit b2fa289
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions src/utils/dialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,20 @@ export namespace Dialog {
);
});
}
export function BackDrop() {
return (
<div
data-tauri-drag-region
className={cn(
"hover:cursor-move active:scale-100 active:cursor-grabbing",
"fixed left-0 top-0 z-[100] h-full w-full bg-black/0 backdrop-blur-0",
{
"bg-black/70 !backdrop-blur-lg": show,
},
)}
></div>
);
}

function Component({
title = "",
Expand Down Expand Up @@ -141,14 +155,7 @@ export namespace Dialog {
))}
</div>
</div>
<div
className={cn(
"fixed left-0 top-0 z-[100] h-full w-full bg-black/0 backdrop-blur-0",
{
"bg-black/70 !backdrop-blur-lg": show,
},
)}
></div>
<BackDrop />
</>
);
}
Expand Down

0 comments on commit b2fa289

Please sign in to comment.