Drag region attribute check (#1907)

This commit is contained in:
Laegel 2021-05-30 22:04:17 +02:00 committed by GitHub
parent 998cbed565
commit 23707764dc
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
---
As some frameworks automatically add "true" as the value of the attribute, we need to check if it exists instead.

View File

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