Skip to content

Commit

Permalink
Allows both OL and UL lists for tab buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
tiesont authored and Johann-S committed Nov 20, 2018
1 parent 7c8cd0f commit ab18338
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions js/src/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class Tab {
const selector = Util.getSelectorFromElement(this._element)

if (listElement) {
const itemSelector = listElement.nodeName === 'UL' ? Selector.ACTIVE_UL : Selector.ACTIVE
const itemSelector = listElement.nodeName === 'UL' || listElement.nodeName === 'OL' ? Selector.ACTIVE_UL : Selector.ACTIVE
previous = $.makeArray($(listElement).find(itemSelector))
previous = previous[previous.length - 1]
}
Expand Down Expand Up @@ -141,7 +141,7 @@ class Tab {
// Private

_activate(element, container, callback) {
const activeElements = container && container.nodeName === 'UL'
const activeElements = container && (container.nodeName === 'UL' || container.nodeName === 'OL')
? $(container).find(Selector.ACTIVE_UL)
: $(container).children(Selector.ACTIVE)

Expand Down
2 changes: 1 addition & 1 deletion site/docs/4.1/components/navs.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The base `.nav` component does not include any `.active` state. The following ex
{% endcapture %}
{% include example.html content=example %}

Classes are used throughout, so your markup can be super flexible. Use `<ul>`s like above, or roll your own with say a `<nav>` element. Because the `.nav` uses `display: flex`, the nav links behave the same as nav items would, but without the extra markup.
Classes are used throughout, so your markup can be super flexible. Use `<ul>`s like above, `<ol>` if the order of your items is important, or roll your own with a `<nav>` element. Because the `.nav` uses `display: flex`, the nav links behave the same as nav items would, but without the extra markup.

{% capture example %}
<nav class="nav">
Expand Down

0 comments on commit ab18338

Please sign in to comment.