Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabs do not preserve url query string #7617

Closed
ivantam-fm opened this issue Sep 15, 2021 · 1 comment
Closed

Tabs do not preserve url query string #7617

ivantam-fm opened this issue Sep 15, 2021 · 1 comment
Labels
markdown Authoring and presenting content using markdown

Comments

@ivantam-fm
Copy link
Contributor

Operating System: (Windows or Linux or MacOS)
Windows 10 20H2
MacOS Big Sur 11.5.1

DocFX Version Used:
2.58.0.0

Template used: (default or statictoc or contain custom template)
default

Steps to Reproduce:

  1. Navigate to a page with tabbed content. e.g. https://example.com?tabs=tabid-1
  2. In the address bar, add a query parameter to the url, e.g. https://example.com?tabs=tabid-1&test=true
  3. In the address bar, press enter to reload the page.

Expected Behavior:
The added query string is preserved.
i.e. https://example.com?tabs=tabid-1&test=true

Actual Behavior:
The added query string is removed, only the tab's query string remains.
i.e. https://example.com?tabs=tabid-1

Possible Bug Location:
Inside docfx.js, line 1001, updateTabsQueryStringParam(state):

function updateTabsQueryStringParam(state) {
  var qs = parseQueryString();
  qs.tabs = state.selectedTabs.join();
  var url = location.protocol + "//" + location.host + location.pathname + "?" + toQueryString(qs) + location.hash;
  if (location.href === url) {
    return;
  }
  history.replaceState({}, document.title, url);
}

var qs = parseQueryString(); should be var qs = parseQueryString(window.location.search);

@KalleOlaviNiemitalo
Copy link

2.58.5 was released, so I think this could now be closed.

@yufeih yufeih added the markdown Authoring and presenting content using markdown label Dec 15, 2022
@yufeih yufeih closed this as completed Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
markdown Authoring and presenting content using markdown
Projects
None yet
Development

No branches or pull requests

3 participants