fix: use button property for data-tauri-drag-region mouse button detection, closes #7694 (#7746)

This commit is contained in:
Jason Tsai 2023-09-07 20:55:47 +08:00 committed by GitHub
parent 53ab2042fd
commit 0797a002ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
'tauri': 'patch:bug'
---
On macOS, fixed tapping on custom title bar doesn't maximize the window.

View File

@ -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