Chrome does not redraw <div> after it is hidden

荒凉一梦 提交于 2019-11-27 22:43:46

Clearly, this is a WebKit bug.

I found that adding -webkit-transform: scale3d(1,1,1); fixes it:

http://jsfiddle.net/thirtydot/y7NdR/5/

I'm not sure if there are any downsides to this fix. I guess this works because inside WebKit, different code is used to render 3D transforms.

I struggled with this for a very long time, and while adding -webkit-transform: scale3d(1,1,1); did fix my issue, I wanted to find out WHY. So, I dug deeper into my code to try and narrow down my issue. I found that i was using a fade in animation, and inside this, I included in the same class:

-webkit-backface-visibility:hidden;
backface-visibility:hidden;

Remove these two lines alone, fixed my issue without the scale transform hack.

Seeing as backface visibility is to do with transforms, and should have no effect on 2D transforms, I removed it and it fixed my issues entirely.

There have been many bugs noted with backface visibility with chrome, so I posted this for any future people trying to find out a fix without too much work.

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