After updating my firefox to version 47.0.1 I discovered a strange issue with position:fixed
.
The bellow snippets works fine in Chrome, IE and Firefox < 47.
However, in Firefox 47+ the .event2
node is not clickable...
After some investigation, I found that it could be fixed by removing the z-index:0
of the .g
element.
Well, actually it could also be fixed by removing the z-index:3
of the .a
element or by removing the overflow: hidden;
of the .f
element.
Fixing is not the problem, but I was wondering if anyone has a clue on what as changed in Firefox 47... Bug or on purpose ? (To me it looks like a bug...)
EDIT: I created a bug report on https://bugzilla.mozilla.org/show_bug.cgi?id=1283436
EDIT2: This is really a bug as it does not occur un Firefox 48 beta
document.querySelector('.event1').addEventListener('click', function() {
alert('foo');
})
document.querySelector('.event2').addEventListener('click', function() {
alert('bar');
})
.a {
z-index: 3;
position: relative;
}
.f {
height: 50px;
width: 100%;
background-color: yellow;
overflow: hidden;
position:relative;
}
.g {
position: absolute;
width: 100%;
height: 100%;
overflow: hidden;
z-index: 0;
}
.k {
height: 50px;
width: 100%;
background-color: red;
}
.l {
position: fixed;
}
.m {
background-color: lime
}
<div class="a">
<div class="f">
<div class="g">
<div class="k event1">
<span>When it is working, this is clickable <br /> and alert (foo) <br /> </span>
<div class="l">
<div class="m event2">
<span>When it is working, this is clickable <br /> and alert (bar) then alert(foo)</span>
</div>
</div>
</div>
</div>
</div>
</div>