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 touch event when target - is not an element #6881

Merged
merged 3 commits into from
Aug 15, 2024

Conversation

Maksims
Copy link
Contributor

@Maksims Maksims commented Aug 14, 2024

We've noticed in many games published on the web through Analytics Error Reporting that there is a case when touchmove event target - is not an element. It could be a window.
Which leads to an exception.

This PR fixes that and also re-uses the existing method within element-input.js as they are identical.

I confirm I have read the contributing guidelines and signed the Contributor License Agreement.

Copy link
Member

@slimbuck slimbuck left a comment

Choose a reason for hiding this comment

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

Nice, approving with code suggestion.

src/platform/input/touch-event.js Outdated Show resolved Hide resolved
@willeastcott willeastcott merged commit 2002df4 into playcanvas:main_v1 Aug 15, 2024
8 checks passed
@willeastcott
Copy link
Contributor

Thank you, @Maksims! 🤗

mvaligursky pushed a commit that referenced this pull request Aug 21, 2024
* fix touch event when target - is not an element

* PR comments

* linter
# Conflicts:
#	src/framework/input/element-input.js
@mvaligursky
Copy link
Contributor

I cherry-picked this change to main branch as well

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.

4 participants