bootstrap icon indicating copy to clipboard operation
bootstrap copied to clipboard

Responsive navbar has fixed height 1st time expanded

Open tysonnero opened this issue 14 years ago • 17 comments

When you expand a responsive fixed navbar for the first time, it sets a fixed height (i.e. 300px) to the expanded area. If you have dropdown links with children, they will not display correctly b/c the area does not grow as they dropdowns expand. Also, if you expand the menu, then go to a larger screen size, the menu area stays expanded.

  • This issue only happens the first time you expand the menu. You won't see an issue on subsequent attempts.
  • I am only experiencing issues in FF and Chrome. IE9 seems to work fine.

Here is a jsFiddle where you can inspect the expanded and see: <div class="nav-collapse in collapse" style="height: 610px; "> http://jsfiddle.net/tysonnero/qPemc/4/


Menu Expanding Normal

1


Menu Expanding Issue 1

When I expand the first dropdown menu, all parent links are now hidden 1


Menu Expanding Issue 2

When I expand the last dropdown menu, all child links under it are hidden 1


Menu Expanding Issue 3

If I leave the menu expanded, and go to a bigger screen size, the menu stays expanded 1

tysonnero avatar Oct 29 '12 15:10 tysonnero

This is by design, and it required for proper animations I believe. It is also very difficult to help you if we do not have a live example or jsfiddle to play with.

We'll work on improving the navbar in upcoming versions though.

mdo avatar Oct 29 '12 16:10 mdo

I included a jsFiddle in the original post...

http://jsfiddle.net/tysonnero/qPemc/4/

tysonnero avatar Oct 29 '12 17:10 tysonnero

This issue makes the menu unusable because you are not able to access all links in dropdowns.

I'm confused why this was closed. It seems like a valid bug that needs to be addressed.

In the mean time, do you recommend just going back to an earlier version as a workaround?

tysonnero avatar Oct 29 '12 17:10 tysonnero

Your fiddle at http://jsfiddle.net/tysonnero/qPemc/4/ looks absolutely correct: dropdowns are expanded because for the time being we have to set a fixed height on the opened navbar. As far as I can tell, there is no bug there.

mdo avatar Oct 30 '12 06:10 mdo

@markdotto I have the issue replicated in the below fiddle. I promise! LOL. The other fiddle was using 2.1.1 which didn't seem to have the changes to responsive-navbar.less. But I updated the fiddle to use 2.2.0, and now the issue is visible.

http://jsfiddle.net/qPemc/7/

Try to expand one of the dropdowns in the navbar when in responsive mode, and you will see the links are cut off.

tysonnero avatar Oct 30 '12 15:10 tysonnero

I too have stumbled upon this issue with the latest stable build; the first time you open the responsive menu any dropdown will not cause the responsive menu to expand, if you then collapse the menu, and re-open it, dropdowns will cause it to expand as needed.

xaroth avatar Nov 06 '12 16:11 xaroth

I am so glad to see i'm not the only one having this problem. Mine is initializing the height to 250px. I can't figure out where it's coming from. It goes back to auto after you collapse and the re-open the menu. IE, FF and Chrome are all doing it.

jleg avatar Nov 08 '12 20:11 jleg

Adding to this, when on a tablet (Just nicked the boss' ipad to confirm) its impossible to click the dropdown items, both in navbar collapsed mode as in normal mode. when pressing on an item in the dropdown the dropdown simply closes and the item below it will handle it's press action.

xaroth avatar Nov 09 '12 15:11 xaroth

I'm having the same problem. Dropdown menu works only after the second time responsive menu is expanded.

erinc avatar Nov 09 '12 21:11 erinc

@tysonnero, @erinc, @jleg It looks like the bug occurs (at least on firefox and chrome) when you include bootstrap-transition.js, like in this fiddle : http://jsfiddle.net/qPemc/11/

If you remove bootstrap-transition.js it works fine, see this fiddle : http://jsfiddle.net/qPemc/8/

Edit : problem found, see my other comment below

drm-wntd avatar Nov 10 '12 02:11 drm-wntd

For me that fixes the dropdown issue, but on chrome (at least) if I click the sub-items of the Dropdown item, it still collapses... so yes, it partially fixes the issue, but not entirely.

xaroth avatar Nov 10 '12 11:11 xaroth

@Xaroth : If you tried clicking the sub-menu items in the jsfiddle (http://jsfiddle.net/qPemc/8/), it's normal that the menu just closes, because almost all the sub-menu items in this fiddle link to the same page (ie : href="#something"). Only one sub-menu item has a link that directs to an inexistant page (404 error) and it's the Help->Documentation sub-menu item. Try to click it. If you get the 404 error, the sub-menu items work fine.

drm-wntd avatar Nov 10 '12 13:11 drm-wntd

@tysonnero : I found out what was wrong with your original fiddle : The "nav-collapse" div in your menu bar also needs the "collapse" class. You forgot it. Check out this fiddle, it should work fine : http://jsfiddle.net/qPemc/14/

drm-wntd avatar Nov 10 '12 20:11 drm-wntd

@drm-wntd :100: Adding the "collapse" class absolutely did the trick.., Good work my friend!

tysonnero avatar Nov 29 '12 01:11 tysonnero

I had the same problem. This "collapse" class is probably a new requirement, as I believe I copied-and-pasted markup from docs a year ago. It's hard to trace such issues, so thank you guys for the solution!

TatianaTyu avatar Jan 27 '13 20:01 TatianaTyu

I had this same issue where dropdowns were being cut off. I put i the additional class of collapse and it now works. The documentation needs to be updated as I am using the latest 2.3.2 release.

CodeArtist1 avatar Jun 11 '13 19:06 CodeArtist1

Adding collapse works to fix the problem for me as well. 2.3.2

EminenceHC avatar Nov 27 '13 17:11 EminenceHC