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

Update EventTarget.js #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

yuedou
Copy link

@yuedou yuedou commented Jan 25, 2021

fix: 当 pageX(Y) 或 clientX(Y) 为 0 时造成 this.pageX(Y) 和 this.clientX(Y) 的值为undefined 的问题。

fix: 当 pageX(Y) 或 clientX(Y)  为 0 时造成 this.pageX(Y) 和 this.clientX(Y) 的值为undefined 的问题。
fix TypeError: (void 0) is not a function
Copy link
Contributor

@ttzztztz ttzztztz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉可以这样写

this.pageX = touch.pageX ?? touch.x ?? 0
// ...

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.

2 participants