Browse Source

Drag region attribute check (#1907)

Laegel 4 years ago
parent
commit
23707764dc
2 changed files with 6 additions and 1 deletions
  1. 5 0
      .changes/fix-attribute-drag-region.md
  2. 1 1
      core/tauri/scripts/core.js

+ 5 - 0
.changes/fix-attribute-drag-region.md

@@ -0,0 +1,5 @@
+---
+"tauri": patch
+---
+
+As some frameworks automatically add "true" as the value of the attribute, we need to check if it exists instead.

+ 1 - 1
core/tauri/scripts/core.js

@@ -190,7 +190,7 @@ if (!String.prototype.startsWith) {
   // drag region
   document.addEventListener('mousedown', (e) => {
     // start dragging if the element has a `tauri-drag-region` data attribute
-    if (e.target.dataset.tauriDragRegion === '' && e.buttons === 1) {
+    if (e.target.hasAttribute('data-tauri-drag-region') && e.buttons === 1) {
       window.__TAURI__.invoke('tauri', {
         __tauriModule: "Window",
         message: {