push url for forms with GET action

fixes https://github.com/bigskysoftware/htmx/issues/485
This commit is contained in:
carson 2021-05-17 11:11:38 -06:00
parent 9a6572f9ee
commit 9c2cda0ee5

View File

@ -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) {
@ -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) {