Skip to content

Commit

Permalink
fix: preventDefault mousedown on data-tauri-drag-region, closes #4059
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Jun 13, 2022
1 parent 69ae6f1 commit a0e2062
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changes/tauri-drag-region-prevent-default.md
@@ -0,0 +1,5 @@
---
"tauri": patch
---

Call `preventDefault()` in the mousedown event handler for `[data-tauri-drag-region]` elements.
1 change: 1 addition & 0 deletions core/tauri/scripts/core.js
Expand Up @@ -134,6 +134,7 @@
// drag region
document.addEventListener('mousedown', (e) => {
if (e.target.hasAttribute('data-tauri-drag-region') && e.buttons === 1) {
e.preventDefault()
// start dragging if the element has a `tauri-drag-region` data attribute and maximize on double-clicking it
window.__TAURI_INVOKE__('tauri', {
__tauriModule: 'Window',
Expand Down

0 comments on commit a0e2062

Please sign in to comment.