From 0da07038e2c6d15b93a7b462ecdfb92d2ec139fc Mon Sep 17 00:00:00 2001 From: Egor <84025024+egornmore@users.noreply.github.com> Date: Wed, 2 Apr 2025 22:21:27 +0300 Subject: [PATCH] Improve URL hash handling with history.replaceState --- src/tinytabs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tinytabs.js b/src/tinytabs.js index 7384307..c810160 100644 --- a/src/tinytabs.js +++ b/src/tinytabs.js @@ -138,7 +138,7 @@ show(sections[id]); opts.onAfter && opts.onAfter(id, newTab); if (opts.anchor) { - document.location.href = "#tab-" + id; + history.replaceState(null, null, "#tab-" + id); } return true; }