bulma
bulma copied to clipboard
Bulma Burger Dropdown rendering under other elements
This is about Bulma.
Overview of the problem
This is about the Bulma CSS framework
I am sure this issue is not a duplicate
Description
I am trying to use the Bulma burger menu when the viewport is smaller than a specific size. I am using react and for some reason i'm unsure of, the dropdown menu that appears when clicking the burger icon seems to be below the rest of the content on the page.
Steps to Reproduce
<nav className="navbar is-transparent" aria-label="main navigation">
<div className="container">
<div className="navbar-brand">
<Link className="navbar-item" to={'/'}>
<img src="https://bulma.io/images/bulma-logo.png" width="112" height="28" />
</Link>
<div className={navBurgerClassName} data-target="navMenu" onClick={() => this.toggleDropDown()}>
<span></span>
<span></span>
<span></span>
</div>
</div>
<div className={navClassName} id="navMenu">
<div className="navbar-end">
<Link className="navbar-item" to={'/'}>Home</Link>
<p className="navbar-item">About</p>
<p className="navbar-item">Our People</p>
<p className="navbar-item">Our Values</p>
<p className="navbar-item">Children's Voices</p>
<div className="navbar-item has-dropdown is-hoverable">
<p className="navbar-link" >More</p>
<div className="navbar-dropdown">
<p className="navbar-item">Contact Us</p>
<Link className="navbar-item" to="/gallery">Gallery</Link>
<Link className="navbar-item" to="/events">Events</Link>
</div>
</div>
</div>
</div>
</div>
</nav>
Expected behavior
The Menu should render above the content on the page, however it is pushed under each of the components except the hero image. I have tried setting the navMenu components z-index to 1000 as seen below but still no affect.

Actual behavior
Is pushed under other components as can be seen in the image below.

A JS Fiddle or something similar would be awesome to help diagnose this.
Just a shot in the dark here (I could be wrong) but I think the navbar or drop-down has a transparent or no background set... like I said I could be wrong here and it may just be z-index related on the navbar itself.
Personally, though I haven't experienced this, the container where the about us text does that have a higher z-index set?
I've encounter the same problem, in which .dropdown-menu
hides under .media-content
even after set z-index
to a large number.
THIS IS A BUG, I assure you. here is a JS F. link Bulma dropdown bug
- click the
level-right
first item (red circle), there should be a popup(dropdown), scroll up and u'll see the dropdown menu is hidden beneath. -
z-index
won't make the dropdown visible.

This is a bug introduced in v0.6.2
. v0.6.1
works properly.
Maybe it's a bug but if you don't touch z-index in any element works fine
I'm running into this as well and I'm having some background issues with @Matt2298's fix. Any progress on this bug? Thx.
Same issue here. Z-index set to 1 on the card and 20 on the dropdown menu, but still getting overlapped.
same problem with .dropdown-menu
and .media-content
This still seems to be happening in 0.7.1. Has anyone found a workaround?
Edit: To elaborate, in my case this is happening when the .navbar-dropdown
would partially obscure a .card
when open. Seems the .card
is taking precedence.
I am experiencing this issue when adding an sub navigation under the top navigation. Top navigation sub menu should display above the light gray one below.
Hi ! Has anyone found a fix for this bug ?
@Ethiel97 I just gave the topmost navbar a higher z-index
.
Having the same issue. No matter what z-index I try my dropdown menu is below the main content panel. Setting navbar as suggested did nothing. Update: my problem is caused by is-fixed-top on my nav. Remove it and it works fine. Not sure how this would be resolved?
In my case the issue is I gave a position static to my navbar. After removing that property everything gets well. You can try it. I hope it will help you.
+1
removing z-index from any navbar items solves this but z-index won't apply to the dropdown-menu - no matter what you do, you cannot overwrite it
Still having this issue, any workaround?
Overwrite $navbar-z
according to your needs in sass/components/navbar.sass:7.
I set a lower z-index to the overlapping elements to fix.
z-index: 1;
Cant seem to find a decent resolution at the moment but for my particular problem (select elements arrow) i implemented this patch.
.select:not(.is-multiple):not(.is-loading):hover::after {
z-index: 4;
}
.select:not(.is-multiple):not(.is-loading)::after {
z-index: 0;
}
Probably similar could be applied to other problem elements.
I ran into this same issue using version 0.7.2. In my case, I have a dropdown-menu for every row of a table, but the dropdown for the bottom rows is being hidden by the parent container. I have a demonstration on Stackblitz.
Same issue with dropdown in every row of a table, also using version 0.7.2 but within an Elm web app.
I have the same issue using a drop-down inside a "media-content" div on Bulma 0.7.4
Note: the problem only manifests below the $tablet breakpoint, viewing the site on a resolution above that breakpoint, the drop-down overlays all other content as required.
I've tried increasing $dropdown-content-z and reducing the z-index of the surrounding content, and it doesn't seem to have any effect.
Edit: i just re-coded the Bulma "media" object as a CSS grid, that works fine, so it seems to be a property of the media or media-content class that's causing the problem for me.
I was also seeing this issue on the bottom row(s) of a table (using DataTables) where every row has a dropdown element. Bulma 0.7.5.
The issue is caused because the container uses overflow:auto
which is why z-index
has no effect regardless of the using a super high value.
I've opted to trigger a scroll event on the table container when the .dropdown-trigger is clicked, which seems to be the most elegant solution. jQuery example below (the margin-bottom is so the bottom border is fully visible):
$('.dropdown-trigger a').on('click', function(){
let menu = $(this).closest('.dropdown').find('.dropdown-menu');
menu.css({'margin-bottom':'3px'});
$(this).closest(".table-container").stop().animate({ scrollTop: (menu.offset().top + menu.outerHeight())}, 500);
});
For reference and if that can help in troubleshooting the issue, the Navbar doc has the issue as shown below
This bug has existed for quite some time. Can something be done to fix this? This is a major blocker for my usecase...
It appears to easily happen when inside a scrolling context, i.e. the last row of a table inside a table-container. If I remove the table-container surrounding the <table>
then it works fine.
This is still occurring for me. Presumably no one has been able to figure out what's causing this?
I set a lower z-index to the overlapping elements to fix.
z-index: 1;
@aysark solution fixed it for me.
In terms of the dropdown clipping within .table-content
this seems to be a known issue from how the CSS spec and browsers treat overflow setting combinations.
It's quite well explained in CSS Tricks but the workaround they suggest involves 2 separate wrappers modifying the various position
attributes to float the dropdown in CSS, and then applying top
and left
values in JS.
Same issue with dropdown in every row of a table, also using version 0.7.2 but within an Elm web app.
Any fix on this? It's obvious this is a bug that needs to be addressed.