AlloyFinger icon indicating copy to clipboard operation
AlloyFinger copied to clipboard

reedit 的 react 版 alloyFinger 有 bug

Open Ragon2019 opened this issue 5 years ago • 0 comments

原版在页面滚动时(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 avatar Dec 10 '20 07:12 Ragon2019