Skip to content

Commit dfd0544

Browse files
authored
Revert "feat(core): add app-region: drag to data-tauri-drag-region (#9789)" (#9860)
* Revert "feat(core): add `app-region: drag` to `data-tauri-drag-region` (#9789)" This reverts commit ae6b13d. * Update pre.json * change files * Discard changes to .changes/pre.json
1 parent 5e8aa6f commit dfd0544

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

.changes/revert-app-region-drag.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"tauri": patch:bug
3+
---
4+
5+
Revert adding `app-region: drag` to HTML elements with `data-tauri-drag-region` on Windows as it has a few issues:
6+
- Doesn't allow right click, as it will always show the system context menu on right click.
7+
- `data-tauri-drag-region` works only if the click was on an element that has it, this allows buttons in the custom titlebar to work, however `app-region: drag` will treat the whole area as a titlebar won't even allow clicks on buttons.

core/tauri/src/window/scripts/drag.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,4 @@
6363
}
6464
})
6565
}
66-
if (osName === 'windows' && 'adoptedStyleSheets' in document) {
67-
const sheet = new CSSStyleSheet()
68-
sheet.replaceSync('*[data-tauri-drag-region] { app-region: drag; }')
69-
document.adoptedStyleSheets = [...document.adoptedStyleSheets, sheet]
70-
}
7166
})()

0 commit comments

Comments
 (0)