fix: drag.js generated CSP regression from #15062

This commit is contained in:
Lucas Nogueira
2026-03-10 14:39:01 -03:00
parent 2dd9b15a2b
commit 3f77cc1ee6

View File

@@ -32,9 +32,9 @@
// Otherwise return true.
//
// Supported values for data-tauri-drag-region:
// (bare / no value) self: only direct clicks on this element trigger drag
// "deep" deep: clicks anywhere in the subtree trigger drag
// "false" disabled: drag is blocked here (and for ancestors)
// (bare / no value) -> self: only direct clicks on this element trigger drag
// "deep" -> deep: clicks anywhere in the subtree trigger drag
// "false" -> disabled: drag is blocked here (and for ancestors)
function isDragRegion(composedPath) {
for (const el of composedPath) {
if (!(el instanceof HTMLElement)) continue
@@ -53,7 +53,7 @@
if (attr === 'deep') return true
// bare (or any unrecognized value): self-only
if (el === composedPath[0]) return true
// click was on a child of a self-only region stop walking, don't drag
// click was on a child of a self-only region - stop walking, don't drag
return false
}
}