Skip to content

Commit

Permalink
push url for forms with GET action
Browse files Browse the repository at this point in the history
  • Loading branch information
strangeRabbit777 committed May 17, 2021
1 parent 20c13f8 commit 1fb1647
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/htmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -926,9 +926,13 @@ return (function () {
if (elt.tagName === "A") {
verb = "get";
path = getRawAttribute(elt, 'href');
nodeData.pushURL = true;
} else {
var rawAttribute = getRawAttribute(elt, "method");
verb = rawAttribute ? rawAttribute.toLowerCase() : "get";
if (verb === true) {
nodeData.pushURL = true;
}
path = getRawAttribute(elt, 'action');
}
triggerSpecs.forEach(function(triggerSpec) {
Expand Down Expand Up @@ -1589,7 +1593,7 @@ return (function () {
function shouldPush(elt) {
var pushUrl = getClosestAttributeValue(elt, "hx-push-url");
return (pushUrl && pushUrl !== "false") ||
(elt.tagName === "A" && getInternalData(elt).boosted);
(getInternalData(elt).boosted && getInternalData(elt).pushURL);
}

function getPushUrl(elt) {
Expand Down

0 comments on commit 1fb1647

Please sign in to comment.