Skip to content

Commit f57b63b

Browse files
committed
Fix browser history
1 parent c38ac3b commit f57b63b

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/reactpy_router/static/link.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
document.querySelector(".UUID").addEventListener("click", (event) => {
2-
event.preventDefault();
3-
let to = event.target.getAttribute("href");
4-
window.history.pushState({}, to, new URL(to, window.location));
5-
});
1+
document.querySelector(".UUID").addEventListener(
2+
"click",
3+
(event) => {
4+
event.preventDefault();
5+
let to = event.target.getAttribute("href");
6+
window.history.pushState({}, to, new URL(to, window.location));
7+
},
8+
{ once: true },
9+
);

0 commit comments

Comments
 (0)