diff --git a/src/htmx.js b/src/htmx.js index da5d4ff49..0b0a8ce31 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -1169,6 +1169,8 @@ var htmx = (function() { } else if (selector === 'root') { item = getRootNode(elt, !!global) } else if (selector.indexOf('global ') === 0) { + // Previous implementation of `global` only supported it at the first position and applied it to the entire selector string. + // For backward compatibility and to maintain logical consistency, we make it apply to everything that follows. parts.unshift(selector.slice(7)) result.push(...querySelectorAllExt(elt, parts.join(','), true)) break