收藏
回答

iphone12 的touchend/tap/longtap 事件都会在手指抬起前提前触发

html:

  <view style="width:100px;height:100px;background-color: pink;" bind:touchstart="touchStart" bind:touchend="touchEnd" bind:touchcancel="touchCancel" bind:tap="tapEvent" bind:longtap="longTap"></view>

js:

  touchStart(e) {
    this.time = Date.now();
    console.log('touchStart', this.time);
  },
  
  touchEnd(e) {
    console.log('touchEnd', Date.now(), Date.now() - this.time);
  },
  
  touchCancel(e) {
    console.log('touchCancel')
    this.handleMicTouchEnd(e);
  },
  
  tapEvent(e) {
    console.log('tapEvent', Date.now(), Date.now() - this.time);
  },
  
  longTap() {
    console.log('longTap', Date.now(), Date.now() - this.time);
  },



实际上触摸并未停止,但是touchend/tap/longtap 事件被提前触发了。

最后一次编辑于  06-20
回答关注问题邀请回答
收藏
登录 后发表内容