bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Nav DropDown Problem

Open adetwiler opened this issue 14 years ago • 30 comments

When you click on the triple horizontal lines to un-collapse the topbar then go back to a full size window and try to open a dropdown, the dropdown no longer opens.

To see the issue occur in jsfiddle, you will probably need two monitors, because it does not got from the mobile nav to the desktop nav.

http://jsfiddle.net/mzYsq/

adetwiler avatar Feb 03 '12 23:02 adetwiler

References #1686

adetwiler avatar Feb 03 '12 23:02 adetwiler

Can you test this and see if it works for you?

https://github.com/twitter/bootstrap/pull/1686#issuecomment-3806683

mindctrl avatar Feb 04 '12 00:02 mindctrl

@mindctrl this does fix the issue. When removing line 77 I am not able to cause it to break anymore. Just to verify I wonder if this would affect any other functionality with the collapse feature, such as this example on bootstrap's docs:

http://twitter.github.com/bootstrap/javascript.html#collapse

I have not tested it, but I will probably get the chance within the next hour, if you don't test it by then :P.

But I assume that if it doesn't break the collapse functionality anywhere else, then that's probably the fix :)

adetwiler avatar Feb 04 '12 00:02 adetwiler

Yah, that broke the demo there. Back to the drawing board. :(

mindctrl avatar Feb 04 '12 00:02 mindctrl

Yeah, I am taking a look at it now, it doesn't show any Javascript errors. I will let you know if I figure something out.

adetwiler avatar Feb 04 '12 00:02 adetwiler

<div class="nav-collapse"> still has the class collapse on, even when you uncollapse the element, which causes the dropdown not to show. I am trying to figure out why collapse is not being removed in bootstrap-collapse.js file.

adetwiler avatar Feb 04 '12 00:02 adetwiler

The problem is that the transition adds the class collapse back to the element, transition is called when you uncollapse an element. I am seeing if I can get a fix now.

adetwiler avatar Feb 04 '12 01:02 adetwiler

Lines 87-89 in boostrap-collapse.js are:

      this.$element
        .trigger(startEvent)
        [method]('in')

I added a line to make it this:

      this.$element
        .trigger(startEvent)
        [method]('in')
        [method]('collapse')

And then my CSS file I added

.collapse.in {
  height:auto !important;
  overflow: visible;
}

as suggested in another thread. Again, this works for the dropdown, but breaks the javascript demo. Thoughts?

mindctrl avatar Feb 04 '12 01:02 mindctrl

I will try that and see what happens.

adetwiler avatar Feb 04 '12 01:02 adetwiler

@mindctrl the problem with adding that in, is that it takes away the animation from both expand and collapse. I am looking to see if I can find a way to keep the animations as well as trying to figure out why the collapse class won't remove properly.

adetwiler avatar Feb 04 '12 01:02 adetwiler

@mindctrl try this and let me know if it works for you

After line 84 add this:

            that.$element
                    .trigger(startEvent)
                    [method]('collapse')

so it should look like this:

            if (startEvent == 'show') that.reset()
            that.$element.trigger(completeEvent)
            that.$element
                    .trigger(startEvent)
                    [method]('collapse')

adetwiler avatar Feb 04 '12 01:02 adetwiler

I will test the example on bootstrap docs and see if it works.

adetwiler avatar Feb 04 '12 01:02 adetwiler

@mindctrl nope still breaks. hmm

adetwiler avatar Feb 04 '12 01:02 adetwiler

@adetwiler using what you did and adding the following CSS to bootstrap.css seems to work all around.

.accordion-body {
  overflow: hidden;
}

mindctrl avatar Feb 04 '12 01:02 mindctrl

@mindctrl nice it seems to work great!

adetwiler avatar Feb 04 '12 01:02 adetwiler

Is your collapse animation broken on the docs example?

mindctrl avatar Feb 04 '12 01:02 mindctrl

Also, my open animation on the navbar button seems to be broken.

Recap:

Navbar: open animation broken, collapse animation working.

Docs example: open animation working, collapse animation broken.

mindctrl avatar Feb 04 '12 01:02 mindctrl

It still works for me.

adetwiler avatar Feb 04 '12 01:02 adetwiler

Hm, I am not seeing those issues with the two things we added.

adetwiler avatar Feb 04 '12 01:02 adetwiler

Ok. I'll check my other CSS and/or test a fresh install.

mindctrl avatar Feb 04 '12 02:02 mindctrl