Dropdown inside collapsable fails the first time because height is not auto #6019

Closed
disposable-ksa98 opened this Issue Nov 27, 2012 · 2 comments

Comments

Projects
None yet
2 participants

I have a dropdown inside a nav-collapse, and this is happening:

  • Load the page in width < 900px
  • Click on btn-navbar to un-collapse
  • Click on dropdown to show the dropdown-menu. Nothing happens.
  • Click twice on btn-navbar to collapse and un-collapse again.
  • Click on dropdown to show the dropdown-menu. Now it works.

Inspecting it with firebug I found that the height is fixed the first time, the second time is auto:

https://s3.amazonaws.com/i.imm.io/N59y.jpeg
https://s3.amazonaws.com/i.imm.io/N5c7.jpeg
https://s3.amazonaws.com/i.imm.io/N5bG.jpeg

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap.css" />
        <link rel="stylesheet" type="text/css" media="screen" href="css/bootstrap-responsive.css" />
        <script src="js/jquery.js"></script>
        <script src="js/bootstrap.js"></script>
    </head>
    <body>
        <div class="navbar">
            <div class="navbar-inner">
                <div class="container">

                    <!-- .btn-navbar is used as the toggle for collapsed navbar content -->
                    <button class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>

                    <!-- Be sure to leave the brand out there if you want it shown -->
                    <a class="brand" href="#">Project name</a>

                    <!-- Everything you want hidden at 940px or less, place within here -->
                    <div class="nav-collapse">
                        <ul class="nav pull-right">
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                                Anonymous <b class="caret"></b>
                                </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a href=''><i class='icon-chevron-right'></i> Login</a>
                                    </li>
                                    <li>
                                        <a href=''><i class='icon-plus'></i> Register</a>
                                    </li>
                                </ul>
                            </li>
                        </ul>
                    </div>

                </div>
            </div>
        </div>
    </body>
</html>
Contributor

mfansler commented Nov 27, 2012

Duplicate of Issue #5890 and Issue #5671. The resolution is to change

<div class="nav-collapse">

to

<div class="nav-collapse collapse">
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment