summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorYaroslav Lapin <jlarky@gmail.com>2023-11-30 15:16:45 -0700
committerGitHub <noreply@github.com>2023-11-30 15:16:45 -0700
commit52826aaeecc06b1044b0ae696cc92c3dae069d4a (patch)
tree73bb20b542490a70fc742aaffbbca65fdd5abd39
parentedafdd17705c76080a516e7851ad56be62d72c1e (diff)
downloadhtmx-52826aaeecc06b1044b0ae696cc92c3dae069d4a.tar.gz
htmx-52826aaeecc06b1044b0ae696cc92c3dae069d4a.zip
fix src/htmx.js(3842,25): error TS2769: No overload matches this call. (#2038)
-rw-r--r--src/htmx.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/htmx.js b/src/htmx.js
index 3677e393..4244b955 100644
--- a/src/htmx.js
+++ b/src/htmx.js
@@ -3838,7 +3838,9 @@ return (function () {
internalData.xhr.abort();
}
});
- var originalPopstate = window.onpopstate;
+ /** @type {(ev: PopStateEvent) => any} */
+ const originalPopstate = window.onpopstate ? window.onpopstate.bind(window) : null;
+ /** @type {(ev: PopStateEvent) => any} */
window.onpopstate = function (event) {
if (event.state && event.state.htmx) {
restoreHistory();