[tabs] Fixed push state to push the full url from the pathname on.
With pushState is being called with the hash string only (e.g., "#tab:...") as the URL argument — when the second arg (title) is "" and third arg is a URL that starts with "#", some browsers and environments treat that as a full URL replacement and strip the path.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
/* DS2 core (c) 2024–2026 Alexander McIlwraith
|
/* DS2 core (c) 2024-2026 Alexander McIlwraith
|
||||||
Released under Creative Commons Attribution-ShareAlike 4.0 International
|
Released under Creative Commons Attribution-ShareAlike 4.0 International
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -154,7 +154,7 @@ export function init(container = document, spacer = true) {
|
|||||||
window.history.pushState(
|
window.history.pushState(
|
||||||
{ tab: tabId },
|
{ tab: tabId },
|
||||||
"",
|
"",
|
||||||
hash
|
`${location.pathname}${location.search}${hash}`
|
||||||
);
|
);
|
||||||
|
|
||||||
pushStateCount++;
|
pushStateCount++;
|
||||||
|
|||||||
Reference in New Issue
Block a user