Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用alloyFinger长按手势,触发事件时由于touches为null引起length属性读取报错 #50

Closed
kokoFE opened this issue Dec 12, 2019 · 1 comment

Comments

@kokoFE
Copy link

kokoFE commented Dec 12, 2019

在浏览器中e.touches返回的是一个类数组对象,始终有length属性。
由于miniprogram-render中Event类进行了如下处理:

this.$_touches = null
...
if (options.touches && options.touches.length) {

        this.$_touches = options.touches.map(touch => ({...touch, target: options.target}))

        this.$$checkTargetTouches()
}

很明显当touches长度为0时 this.$_touches 不会被处理成一个空数组。
changedTouches、 targetTouches可能也有类似情况,希望可以做出相关修改,避免冲突。

@JuneAndGreen
Copy link
Collaborator

已做出相关修复,可以尝试下这个包:miniprogram-render@0.5.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants