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 using the scroll wheel does not trigger the scroll-end event

Merged
merged 2 commits into from Dec 9, 2019

Conversation

knoxHuang
Copy link
Contributor

@knoxHuang knoxHuang commented Dec 2, 2019

Re: https://forum.cocos.org/t/scrollview-scroll-ended/86623/2

Changes:

  • 修复通过滚轮滚动 scrollview 无法触发 scroll-end 事件

@holycanvas holycanvas requested a review from PPpro Dec 2, 2019
@@ -792,6 +792,7 @@ let ScrollView = cc.Class({
this._processDeltaMove(deltaMove);

if(!this._stopMouseWheel) {
this._dispatchEvent('scroll-ended');
Copy link
Contributor

@PPpro PPpro Dec 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个事件是不是在 这里派发比较好

            this.unschedule(this._checkMouseWheel);

PPpro
PPpro approved these changes Dec 3, 2019
@@ -807,6 +807,7 @@ let ScrollView = cc.Class({
if (!currentOutOfBoundary.fuzzyEquals(cc.v2(0, 0), EPSILON)) {
this._processInertiaScroll();
this.unschedule(this._checkMouseWheel);
this._dispatchEvent('scroll-ended');
Copy link
Contributor

@holycanvas holycanvas Dec 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个事件没有枚举值么

Copy link
Contributor Author

@knoxHuang knoxHuang Dec 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其他地方也是用字符串,没有特意去更修改

Copy link
Contributor

@holycanvas holycanvas Dec 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为了和用户自定义事件统一管理,就都用字符串了

@holycanvas holycanvas merged commit 7988f31 into cocos:v2.3.0 Dec 9, 2019
1 check passed
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.

None yet

3 participants