firefox transitions breaking when parent overflow is changed

陌路散爱 提交于 2019-12-09 18:31:56

问题


i came across an issue today and it took me so long to debug, I couldn't find a solution anywhere online so I thought it would be useful to document

It seems that transitions do not work on Firefox if the parent's "overflow" property is changed together with the transition - ie:

.parent { overflow: hidden; }
.parent:hover { overflow: visible; }
.child { opacity: 1; transition: opacity 1s linear; }
.parent:hover .child { opacity: 0; }

The transitions will not work on the child. Remove the "overflow:visible" property from the hovered parent, and everything is ok. It seems that changing the overflow on the child itself does not cause any issues, which is weird.

Here's a js fiddle for this http://jsfiddle.net/qzMj9/13/

does anyone know why this happens? is it a ff bug or the correct functionality? it works on webkit!


回答1:


This looks like https://bugzilla.mozilla.org/show_bug.cgi?id=625289 to me: the parent is having its CSS boxes reconstructed, which loses the old computed style on the child, which means no transition start, since that's triggered by computed style changes.



来源:https://stackoverflow.com/questions/13626412/firefox-transitions-breaking-when-parent-overflow-is-changed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!