manual test for keeping indicators visible

This commit is contained in:
Carson Gross 2024-08-05 12:29:33 -06:00
parent e99d8976f5
commit df16ed8e96
3 changed files with 30 additions and 1 deletions

View File

@ -4585,7 +4585,6 @@ var htmx = (function() {
ajaxHelper('get', redirectPath, redirectSwapSpec).then(function() {
pushUrlIntoHistory(redirectPath)
})
responseInfo.keepIndicators = true;
return
}

View File

@ -0,0 +1 @@
Some Text...

View File

@ -0,0 +1,29 @@
<html lang="en">
<head>
<meta charset="utf-8" />
<script type="application/javascript" src="../../../src/htmx.js"></script>
<title>History - Index</title>
<script>
htmx.logAll();
htmx.onLoad(function(src){
var btn = src.querySelector("button");
btn.addEventListener("htmx:beforeOnLoad", function(evt){
evt.detail.keepIndicators = true;
})
})
</script>
</head>
<body style="padding:20px;font-family: sans-serif">
<h1>Indicator Visibility Test</h1>
<p>
This test marks the response as <code>keepIndicators</code>, so the indicator span should remain visible after the
request finishes.
</p>
<button hx-get="1.html" hx-indicator="#indicator">
Click Me
</button>
<span id="indicator" class="htmx-indicator">
Should Remain Visible...
</span>
</body>
</html>