]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fix: do not corrupt location.href when changing deep-linked tabs
authorameotoko <andrey.vinichenko@gmail.com>
Tue, 2 Aug 2022 19:55:38 +0000 (21:55 +0200)
committerameotoko <andrey.vinichenko@gmail.com>
Tue, 2 Aug 2022 19:55:38 +0000 (21:55 +0200)
js/foundation.tabs.js

index 55a0b7f5e235300af76ec7730ddffa55f264912d..c44c1e435de410c26a22ef5dc69cbf82ba30cb1d 100644 (file)
@@ -269,9 +269,9 @@ class Tabs extends Plugin {
     //either replace or update browser history
     if (this.options.deepLink && !historyHandled) {
       if (this.options.updateHistory) {
-        history.pushState({}, '', anchor);
+        history.pushState({}, '', location.pathname + location.search + anchor);
       } else {
-        history.replaceState({}, '', anchor);
+        history.replaceState({}, '', location.pathname + location.search + anchor);
       }
     }