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

reedit 的 react 版 alloyFinger 有 bug #140

Open
Ragon2019 opened this issue Dec 10, 2020 · 0 comments
Open

reedit 的 react 版 alloyFinger 有 bug #140

Ragon2019 opened this issue Dec 10, 2020 · 0 comments

Comments

@Ragon2019
Copy link

原版在页面滚动时(scroll)取消了 touch 相关事件的监听
`
this._cancelAllHandler = this.cancelAll.bind(this);
window.addEventListener('scroll', this._cancelAllHandler);

cancelAll: function () {
this._preventTap = true
clearTimeout(this.singleTapTimeout);
clearTimeout(this.tapTimeout);
clearTimeout(this.longTapTimeout);
clearTimeout(this.swipeTimeout);
},
`

react 版里没有做同样的事情
`
_handleTouchCancel(evt) {
this._emitEvent('onTouchCancel', evt);
clearInterval(this.singleTapTimeout);
clearInterval(this.tapTimeout);
clearInterval(this.longTapTimeout);
clearInterval(this.swipeTimeout);
}

render() {
return React.cloneElement(React.Children.only(this.props.children), {
onTouchStart: this._handleTouchStart.bind(this),
onTouchMove: this._handleTouchMove.bind(this),
onTouchCancel: this._handleTouchCancel.bind(this),
onTouchEnd: this._handleTouchEnd.bind(this)
});
}

`

@Ragon2019 Ragon2019 reopened this Apr 9, 2021
@Ragon2019 Ragon2019 reopened this Apr 9, 2021
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

No branches or pull requests

1 participant