From 0797a002caad29cd8bedccf01f64bf3b45a5e528 Mon Sep 17 00:00:00 2001 From: Jason Tsai Date: Thu, 7 Sep 2023 20:55:47 +0800 Subject: [PATCH] fix: use `button` property for `data-tauri-drag-region` mouse button detection, closes #7694 (#7746) --- .changes/tauri-tap-drag-region-detection.md | 5 +++++ core/tauri/scripts/core.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changes/tauri-tap-drag-region-detection.md diff --git a/.changes/tauri-tap-drag-region-detection.md b/.changes/tauri-tap-drag-region-detection.md new file mode 100644 index 000000000000..f28c23f4fb9c --- /dev/null +++ b/.changes/tauri-tap-drag-region-detection.md @@ -0,0 +1,5 @@ +--- +'tauri': 'patch:bug' +--- + +On macOS, fixed tapping on custom title bar doesn't maximize the window. diff --git a/core/tauri/scripts/core.js b/core/tauri/scripts/core.js index 9424b7504c2c..5eaefba47edb 100644 --- a/core/tauri/scripts/core.js +++ b/core/tauri/scripts/core.js @@ -134,7 +134,7 @@ // drag region 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