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

fix: catchEvent empty points, 不传入el,用catchEvent传入事件的方式,points无法初始化 #126

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ispiders
Copy link

不传入el,用catchEvent传入事件的方式,points无法初始化

const at = new AnyTouch();
at.catchEvent(touchevent);

这种方式使用会报错,原因是createInput的过程中在判断 eventTarget 是否在根元素下时,由于未指定根元素,导致所有的touch点都被过滤了。于是后续处理过程中points全是空数组,导致报错。

不传入el,用catchEvent传入事件的方式,points无法初始化

``` javascript
const at = new AnyTouch();
at.catchEvent(touchevent);
```
这种方式使用会报错,原因是createInput的过程中在判断 eventTarget 是否在根元素下时,由于未指定根元素,导致所有的touch点都被过滤了。于是后续处理过程中points全是空数组,导致报错。
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

Successfully merging this pull request may close these issues.

None yet

1 participant