fix(window): use button property for data-tauri-drag-region left mouse button detection (#590)

This commit is contained in:
Jason Tsai
2023-09-05 01:09:23 +08:00
committed by GitHub
parent 2cb0fa719b
commit 70e535abd5
2 changed files with 6 additions and 1 deletions
@@ -0,0 +1,5 @@
---
"window": "patch"
---
On macOS, fixed tapping on custom title bar doesn't maximize the window.
+1 -1
View File
@@ -3,7 +3,7 @@
// SPDX-License-Identifier: MIT
document.addEventListener("mousedown", (e) => {
if (e.target.hasAttribute("data-tauri-drag-region") && e.buttons === 1) {
if (e.target.hasAttribute("data-tauri-drag-region") && e.button === 0) {
// prevents text cursor
e.preventDefault();
// fix #2549: double click on drag region edge causes content to maximize without window sizing change