Skip to content

Commit

Permalink
Comment why global can't be normal
Browse files Browse the repository at this point in the history
  • Loading branch information
Telroshan committed Sep 23, 2024
1 parent 8cd3799 commit 8e23149
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/htmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e23149

Please sign in to comment.