【问题标题】:position:fixed issue in Firefox 47 only位置:仅在 Firefox 47 中修复问题
【发布时间】:2016-06-30 09:01:19
【问题描述】:

在将我的 Firefox 更新到 47.0.1 版本后,我发现 position:fixed 存在一个奇怪的问题。 下面的 sn-ps 在 Chrome、IE 和 Firefox .event2 节点不可点击...

经过一番调查,我发现可以通过删除.g元素的z-index:0来修复它。 好吧,实际上它也可以通过删除 .a 元素的 z-index:3 或删除 .f 元素的 overflow: hidden; 来修复。

修复不是问题,但我想知道是否有人知道 Firefox 47 中发生了什么变化......错误或故意? (对我来说它看起来像一个错误......)

编辑:我在https://bugzilla.mozilla.org/show_bug.cgi?id=1283436上创建了一个错误报告

EDIT2:这确实是一个错误,因为它不会在 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 /> &nbsp; </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>

【问题讨论】:

  • 使用 FF47,然后更新到 FF47.0.1 无法重现这一点,所以对我来说似乎不是一个错误,它甚至没有提醒(bar)
  • 这就是问题所在。单击它应该显示警报,但没有被触发
  • 第一次被解雇,第二次没有解雇任何人
  • 第一个(红色的)确实有效,但第二个(石灰的)也应该触发alert,但它没有。在 Chrome 中尝试相同的操作,您会看到两者都在提醒

标签: css firefox firefox-47


【解决方案1】:

这确实是Firefox从46.0.1版本开始的回归 最高版本 48.0a2

为了记录,可以在此处跟踪原始错误: https://bugzilla.mozilla.org/show_bug.cgi?id=1275411

【讨论】:

    猜你喜欢
    • 2012-11-08
    • 1970-01-01
    • 1970-01-01
    • 2013-06-06
    • 1970-01-01
    • 2012-10-17
    • 1970-01-01
    • 2014-09-15
    • 2011-06-26
    相关资源
    最近更新 更多