AlloyFinger icon indicating copy to clipboard operation
AlloyFinger copied to clipboard

touchend时,是不是应该用changedTouches访问当前触摸点对象

Open narol1024 opened this issue 6 years ago • 3 comments

https://github.com/AlloyTeam/AlloyFinger/blob/9d0db8e19789c8d34e082a81903760766bee3315/react/AlloyFinger.jsx#L167

貌似touchend触发后,只有event.changedTouches才能访问到触摸点对象,targetTouchestouches此时为空了。

另外为什么判断length < 2时才触发onMultipointEnd,不解,或者说,怎么样判断是单点触发end还是多点触发end事件?

narol1024 avatar Mar 18 '18 07:03 narol1024

touches 可以访问到还遗留在屏幕上的 触点啊~~

dntzhang avatar Mar 19 '18 02:03 dntzhang

假设是多触摸点的话,同时松开,那么touches在touchend应该为空了,changedTouches则不会

narol1024 avatar Mar 19 '18 02:03 narol1024

现在比较尴尬的事,单点触摸也会触发multipointEnd事件,同这个issue

narol1024 avatar Mar 19 '18 02:03 narol1024