Skip to content

Commit

Permalink
Drag region attribute check (#1907)
Browse files Browse the repository at this point in the history
  • Loading branch information
Laegel authored May 30, 2021
1 parent 998cbed commit 2370776
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-attribute-drag-region.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion core/tauri/scripts/core.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down

0 comments on commit 2370776

Please sign in to comment.