Skip to content

dropdowns in tabs never get .active #355

@ghost

Description

When combining drop downs with tabs (http://twitter.github.com/bootstrap/javascript.html#dropdown) I find that the drop down list never gets the .active class, only the element within the drop down list gets it.

<ul class="tabs" data-tabs="tabs">
    <li class="active"><a href="#">Home</a></li>
    <li class="dropdown" data-dropdown="dropdown" >
        <a href="#" class="dropdown-toggle">Dropdown</a>
        <ul class="dropdown-menu">
            <li><a href="#">Secondary link</a></li>
            <li><a href="#">Something else here</a></li>
            <li class="divider"></li>
            <li><a href="#">Another link</a></li>
        </ul>
    </li>
</ul>

Clicking on Another link returns:

<ul class="tabs" data-tabs="tabs">
    <li class="active"><a href="#">Home</a></li>
    <li class="dropdown" data-dropdown="dropdown" >
        <a href="#" class="dropdown-toggle">Dropdown</a>
        <ul class="dropdown-menu">
            <li><a href="#">Secondary link</a></li>
            <li><a href="#">Something else here</a></li>
            <li class="divider"></li>
            <li class="active"><a href="#">Another link</a></li>
        </ul>
    </li>
</ul>

(active stays on the original element as well)
What I expected:

<ul class="tabs" data-tabs="tabs">
    <li class=""><a href="#">Home</a></li>
    <li class="dropdown active" data-dropdown="dropdown">
        <a href="#" class="dropdown-toggle">Dropdown</a>
        <ul class="dropdown-menu">
            <li><a href="#">Secondary link</a></li>
            <li><a href="#">Something else here</a></li>
            <li class="divider"></li>
            <li class="active"><a href="#">Another link</a></li>
        </ul>
    </li>
</ul>

I am not sure if this was the intended functionality, however I think it would be nice if there was at least an option for the dropdown to get .active when selected.

Browser: Firefox 7.0.1 OSX 10.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions