From 6ea0567c4c800ef18cda2c23fc55f691e5ace952 Mon Sep 17 00:00:00 2001 From: Jason Tsai Date: Mon, 4 Sep 2023 23:11:04 +0800 Subject: [PATCH] fix: use `button` property for `data-tauri-drag-region` mouse button detection --- .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