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

fix bug: onPageScroll blocks page UI refresh because of hundreds of $app… #985

Merged
merged 1 commit into from
Feb 28, 2018

Conversation

cuijiemmx
Copy link

修复#957

@coveralls
Copy link

coveralls commented Feb 26, 2018

Coverage Status

Coverage increased (+0.05%) to 60.385% when pulling 49eae3d on cuijiemmx:1.7.x into 875157b on Tencent:1.7.x.

@wells1013
Copy link

if (!page.onPageScroll) {
delete config.onPageScroll;
}
如果page 对象里没有 onPageScroll 但是mixin 里有呢?

@cuijiemmx
Copy link
Author

cuijiemmx commented Feb 26, 2018

pull request已更新,加入了对 @wells1013 所述情况的检测并加入了注释,解决下面两个问题:

  1. page和page mixins都未定义onPageScroll时,wepy不会自动加入onPageScroll,不然页面滚动中真机控制台log中会出现海量的无用onPageScroll的log
  2. page或page mixins中定义了onPageScroll时,页面滚动过程中wepy不会自动调用page.$apply()以免block UI刷新

@cuijiemmx
Copy link
Author

另外扩展一下,如果page和page mixins中都未定义某个事件处理函数,是不是都不应该让wepy自动加入这个事件处理函数?

@cuijiemmx cuijiemmx changed the title fix bug: onPageScroll blocks page UI refresh because hundreds of $app… fix bug: onPageScroll blocks page UI refresh because of hundreds of $app… Feb 26, 2018
@Gcaufy Gcaufy merged commit f7f2f24 into Tencent:1.7.x Feb 28, 2018
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.

4 participants