mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-29 08:11:06 +00:00
fix(window): prevent double-toggle on titlebar double-click (#179)
data-tauri-drag-region already handles double-click to maximize natively; the @dblclick handler was calling toggleMaximize() again, immediately restoring the window.
This commit is contained in:
@@ -43,9 +43,10 @@ const emit = defineEmits<{
|
||||
}>();
|
||||
|
||||
const { t } = useI18n();
|
||||
const { isMac, showControls, isMaximized, minimize, toggleMaximize, close } = useWindowControls();
|
||||
const { isMac, isDesktop, showControls, isMaximized, minimize, toggleMaximize, close } = useWindowControls();
|
||||
|
||||
function onToolbarDblClick(e: MouseEvent) {
|
||||
if (isDesktop) return;
|
||||
const target = e.target as HTMLElement;
|
||||
if (target.closest("button, [role='button'], a")) return;
|
||||
toggleMaximize();
|
||||
|
||||
Reference in New Issue
Block a user