收藏
回答

skyline 手势操作返回报错null reading \'touches\'?

报错信息:Cannot read properties of null (reading \'touches\')

报错机型多为安卓机(JEF-AN00、JAD-AL50、ANN-AN00、2206123SC),微信版本8.0.48、8.0.49

代码片段

<vertical-drag-gesture-handler
  tag="pan"
  shouldResponseOnMove="shouldPanResponse"
  simultaneousHandlers="{{ ['scroll'] }}"
  onGestureEvent="handleVerticalDrag"
  style="flex: 1; overflow: auto;width: 100%;"
>
  <view>...<view>
<vertical-drag-gesture-handler>

js代码片段

handleVerticalDrag(evt) {
  'worklet';

  if (!this.customRouteContext) return;
  if (evt.state === GestureState.BEGIN) {
    this.handleDragStart();
  } else if (evt.state === GestureState.ACTIVE) {
    const delta = evt.deltaY / windowHeight;
    this.handleDragUpdate(delta);
  } else if (evt.state === GestureState.END) {
    const velocity = evt.velocityY / windowHeight;
    this.handleDragEnd(velocity);
    this.jsWorklet(evt.state);
  } else if (evt.state === GestureState.CANCELLED) {
    this.handleDragEnd(0.0);
    this.jsWorklet(evt.state);
  }
}
回答关注问题邀请回答
收藏

1 个回答

  • 黄思程
    黄思程
    06-03

    提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。

    06-03
    有用
    回复 1
    • zz@zz
      zz@zz
      06-03
      不是必现的,代码如上,线上每天有几十条报错,全部都是安卓机型
      06-03
      回复
登录 后发表内容