Skip to content

Commit

Permalink
attempt to fix #463
Browse files Browse the repository at this point in the history
  • Loading branch information
carson committed May 17, 2021
1 parent bdefbd4 commit 4dd5004
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/htmx.js
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,15 @@ return (function () {
var nodeData = getInternalData(elt);
if (!nodeData.revealed && isScrolledIntoView(elt)) {
nodeData.revealed = true;
issueAjaxRequest(nodeData.verb, nodeData.path, elt);
if (nodeData.initialized) {
issueAjaxRequest(nodeData.verb, nodeData.path, elt);
} else {
// if the node isn't initialized, wait for it before triggering the request
elt.addEventListener("htmx:afterProcessNode",
function () {
issueAjaxRequest(nodeData.verb, nodeData.path, elt);
}, {once: true});
}
}
}

Expand Down

0 comments on commit 4dd5004

Please sign in to comment.