Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复线上demo 点击actionSheet 蒙层显示无动画的bug; #331

Closed
wants to merge 1 commit into from

Conversation

Qing-xiu
Copy link

因为clone下来的demo 跟 线上的代码不太一样,所以做了多处修改,保持跟线上的代码一致

@progrape
Copy link
Collaborator

@sklthegoodman @shangbinbin 请 kl 跟进这个问题

@sklme
Copy link
Contributor

sklme commented Apr 20, 2016

因为display属性不是有粒度的属性,所以当一个事件让display属性发生改变时,transition将不会触发。解决的办法是触发在切换display属性之后,强行触发一次页面的重排(reflow)。

在你的解决方案里,其实就是利用getComputedStyle()触发了一次页面的重排,而突然调用这个方法又不使用返回值,似乎有点奇怪,所以建议用focus()代替,focus也会触发reflow。你的分支和weui的分支有冲突,就不合并了。

所有触发reflow的方式:
https://gist.github.com/paulirish/5d52fb081b3570c81e3a

参考链接:
http://stackoverflow.com/questions/22103006/css3-transition-doesnt-work-with-display-property
http://stackoverflow.com/questions/3331353/transitions-on-the-display-property

@progrape
Copy link
Collaborator

#333

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants