diff --git a/.changeset/yellow-dancers-give.md b/.changeset/yellow-dancers-give.md new file mode 100644 index 0000000..39a07f8 --- /dev/null +++ b/.changeset/yellow-dancers-give.md @@ -0,0 +1,5 @@ +--- +'@vtbag/turn-signal': patch +--- + +Fixes an issue where the scripts where not reexecuted when fetched from the bfcache. diff --git a/src/forced-traversal.ts b/src/forced-traversal.ts index 055a084..5830f4c 100644 --- a/src/forced-traversal.ts +++ b/src/forced-traversal.ts @@ -20,4 +20,4 @@ function navigate(e: NavigateEvent) { } } } -navigation?.addEventListener('navigate', navigate, { once: true }); +navigation?.addEventListener('navigate', navigate); diff --git a/src/index.ts b/src/index.ts index ef7b29e..6877996 100644 --- a/src/index.ts +++ b/src/index.ts @@ -72,4 +72,4 @@ function allPages() { : []; } -'onpagereveal' in window && addEventListener('pagereveal', pageReveal, { once: true }); +'onpagereveal' in window && addEventListener('pagereveal', pageReveal);