diff options
author | Noa Aarts <itepastra@gmail.com> | 2023-12-20 23:38:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-20 15:38:25 -0700 |
commit | 1f4903c213cc37f4d995c0585c2c01c850b0a5e9 (patch) | |
tree | 4d318e4c3fba5ce389400b0f885d12232d4e7af7 /src/htmx.js | |
parent | e9bce8db65c37f40935ca44bcb3b13581ea0dcd8 (diff) | |
download | htmx-1f4903c213cc37f4d995c0585c2c01c850b0a5e9.tar.gz htmx-1f4903c213cc37f4d995c0585c2c01c850b0a5e9.zip |
rewrite the HX-Retarget header to use extended query selectors (#2017)
Diffstat (limited to 'src/htmx.js')
-rw-r--r-- | src/htmx.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/htmx.js b/src/htmx.js index e81d96a9..2bb58239 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -3504,7 +3504,11 @@ return (function () { } if (hasHeader(xhr,/HX-Retarget:/i)) { - responseInfo.target = getDocument().querySelector(xhr.getResponseHeader("HX-Retarget")); + if (xhr.getResponseHeader("HX-Retarget") === "this") { + responseInfo.target = elt; + } else { + responseInfo.target = querySelectorExt(elt, xhr.getResponseHeader("HX-Retarget")); + } } var historyUpdate = determineHistoryUpdates(elt, responseInfo); |