Skip to content

Possibility of using the same pane IDs on the page when you have multiple different tab instances #1

@dmitriyakkerman

Description

@dmitriyakkerman

Now it's impossible to use the same ID's when you have multiple different tab instances.
Example:

<div class="blog">
<ul class="tabs">
    <li>
        <button data-pane="pane-1">Link 1</button>
    </li>
    <li>
        <button data-pane="pane-2">Link 2</button>
    </li>
</ul>
<div id="pane-1">Content 1</div>
<div id="pane-2">Content 2</div> 
</div>
<div class="testimonials">
<ul class="tabs">
    <li>
        <button data-pane="pane-1">Link 1</button>
    </li>
    <li>
        <button data-pane="pane-2">Link 2</button>
    </li>
</ul>
<div id="pane-1">Content 1</div>
<div id="pane-2">Content 2</div> 
</div>
new ArmUI.Tabs({
    tabTogglers: '.blog .tabs button'
})

new ArmUI.Tabs({
    tabTogglers: '.testimonials.tabs button'
})

When you have more than 1 instance, all instances excepting the firsy won't work correctly cause we have the same pane IDs: pane-1 and pane-2.
To fixed that you need to use different ID's, for example:

<div class="blog">
<ul class="tabs">
    <li>
        <button data-pane="pane-1">Link 1</button>
    </li>
    <li>
        <button data-pane="pane-2">Link 2</button>
    </li>
</ul>
<div id="pane-1">Content 1</div>
<div id="pane-2">Content 2</div> 
</div>
<div class="testimonials">
<ul class="tabs">
    <li>
        <button data-pane="pane-10">Link 1</button>
    </li>
    <li>
        <button data-pane="pane-20">Link 2</button>
    </li>
</ul>
<div id="pane-1">Content 1</div>
<div id="pane-2">Content 2</div> 
</div>

Would be nice to fix this behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions