报错信息: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);
}
}
提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。