Skip to content

Commit a0e2062

Browse files
committed
fix: preventDefault mousedown on data-tauri-drag-region, closes #4059
1 parent 69ae6f1 commit a0e2062

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri": patch
3+
---
4+
5+
Call `preventDefault()` in the mousedown event handler for `[data-tauri-drag-region]` elements.

core/tauri/scripts/core.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@
134134
// drag region
135135
document.addEventListener('mousedown', (e) => {
136136
if (e.target.hasAttribute('data-tauri-drag-region') && e.buttons === 1) {
137+
e.preventDefault()
137138
// start dragging if the element has a `tauri-drag-region` data attribute and maximize on double-clicking it
138139
window.__TAURI_INVOKE__('tauri', {
139140
__tauriModule: 'Window',

0 commit comments

Comments
 (0)