unimelb / unimelb-design-system

A complete design system for the University of Melbourne
https://web.unimelb.edu.au
30 stars 12 forks source link

Using buttons to navigate to different tabs no longer works #842

Closed axelboc closed 7 years ago

axelboc commented 7 years ago

Expected behaviour

Setting attribute data-tab="1" on a button turns this button into a trigger to navigate to the first tab.

Actual behaviour

When the button is clicked, the page scrolls and tab 1 becomes selected, but the corresponding tab panel is not displayed.

Steps to reproduce

  1. Visit http://web.unimelb.edu.au/components/tabs/#tab3
  2. Click on button "Go back to tab 1"
rothenburycam commented 7 years ago

Seems to work on this page for some reason: http://gradresearch.unimelb.edu.au/

Steps to reproduce

  1. Visit http://gradresearch.unimelb.edu.au/
  2. Click on button "See all guides" at bottom of page
axelboc commented 7 years ago

The tab panels were being initialised in the wrong order, so when attempting to switch to a tab at a specific index, the wrong panel was being shown (e.g. when trying to switch to tab #1 in a 3-tab component, it would switch to tab #3). You can use this fact to make your data-tab buttons work until the next patch version is released.