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: Browser back doesn't take us back to default tab #11100

Closed
jamiechong opened this issue Mar 27, 2018 · 0 comments · Fixed by #11477
Closed

Tabs: Browser back doesn't take us back to default tab #11100

jamiechong opened this issue Mar 27, 2018 · 0 comments · Fixed by #11477

Comments

@jamiechong
Copy link
Contributor

How to reproduce this bug:

  1. Setup some tabs
  2. Set these options: data-deep-link="true" and data-update-history="true". The 2nd option pushes state onto the browser history.
  3. Click a few random tabs
  4. Click the browser back button and watch the URL bar
  5. Repeat step 4 multiple times

The hash changes as you click the tabs. When clicking back the state reverses and the previous tab loads accordingly. However, when getting back to the original URL, the tab state doesn't update.

  • Landing page -> example.com/ -> active Tab 1
  • Click Tab 2 -> example.com/#tab-2 -> active Tab 2
  • Click browser back -> example.com/ -> active Tab 2 (BUG)

Browser(s) and Device(s) tested on:

Desktop Chrome

Foundation Version(s) you are using:

6.4.3

Test case link:

https://codepen.io/anon/pen/LdeRmW

ncoden added a commit to ncoden/foundation-sites that referenced this issue Aug 26, 2018
…oundation#11100

When deep-linking is enabled and the user goes back in the history up to when no hash is set, display the initially-selected content/tab instead of staying with the content/tab that was selected the first.

Closes foundation#11100
Replaces foundation#11101
ncoden added a commit to ncoden/foundation-sites that referenced this issue Aug 26, 2018
…oundation#11100

When deep-linking is enabled and the user goes back in the history up to when no hash is set, display the initially-selected content/tab instead of staying with the content/tab that was selected the first.

Closes foundation#11100
Replaces foundation#11101

Co-authored-by: Jamie Chong <[email protected]>
ncoden added a commit that referenced this issue Sep 12, 2018
fix: return to initial state when reseting hash in Accordion & Tabs #11100
ncoden added a commit to ncoden/foundation-sites that referenced this issue Sep 12, 2018
…nking-11100 for v6.5.0

5ea51f3 fix: return to initial state when reseting hash in Accordion & Tabs foundation#11100
314b4ee fix: fix initial state for Accordion without any panel active
abbbdbf refactor: split DOM operations from logics in Accordion
e261905 refactor: move "init only" Accordion logic to its own methods
b819faf docs: remove outdated comments in Accordion related to the initial state
7307c43 feat: add "Tabs._collapse()" to collapse the active tab
012db10 refactor: clean up the Tab initialization
c6d37c4 fix: close the active Tab when going back to a "tab-less" history state
2673567 docs: fix "zplugin" typo in Accordion & Tabs events

Signed-off-by: Nicolas Coden <[email protected]>
@ncoden ncoden mentioned this issue Sep 12, 2018
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants