question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

z-index being improperly set

See original GitHub issue

I’m using bootstrap-datepicker in a project where it sits next to another widget.

In Safari, the z-index is being manually set to 10. However, the widget that it sits next to is set to 999. So whenever the date picker drop down is displayed, it shows up UNDER the widget next to it.

In Firefox, the z-index is not set, so this behavior is not apparent.

Solution: you are already attaching a .datepicker-dropdown class to the drop down. Simply let us developers customize that class with our own z-index value so that we can make sure it is properly positioned on our pages.

Don’t manually set it in code.

Issue Analytics

  • State:open
  • Created 8 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
rosskevincommented, Oct 28, 2015

I have a situation where a sibling element (not parent) is absolutely positioned. In this rare case, hardcoding the z-index with !important works i.e.

.datepicker-dropdown {
  z-index: 1036 !important;
}
0reactions
Azaretcommented, Jun 16, 2015

Tried on the last version and it looks fine.

Read more comments on GitHub >

github_iconTop Results From Across the Web

4 reasons your z-index isn't working (and how to fix it)
Check that the elements have their position set and z-index numbers in the correct order. Make sure that you don't have parent elements...
Read more >
z-index not working with fixed positioning - Stack Overflow
This happens because the z-index property is ignored in position: static; , which happens to be the default value; so in the CSS...
Read more >
What The Heck, z-index?? - Josh W Comeau
In general, z-index only works with "positioned" elements (elements that set position to something other than the default “static”). But the ...
Read more >
The Z-Index CSS Property: A Comprehensive Look
This is caused by the positioned element wrapping the grey box. Those browsers incorrectly “reset” the stacking context in relation to the ...
Read more >
Stop (ab)using z-index - Codegram
That developer must have been really desperate, but it's very common to see things like z-index: 9999 , and if that doesn't work,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found