-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
Hey everyone,
When I try to access the id
-field on touches contained within an ElementTouchEvent
, I always receive undefined
. Upon further inspection, it turns out touches contained within ElementTouchEvent
are of the DOM Touch
-type rather than ElementTouchEvent.Touch
as declared by the most recent PlayCanvas type definitions (playcanvas@2.10.6 from NPM).
Here's a screenshot of VSCode showing the type of the touch
-field on an ElementTouchEvent
:

Here's a confirmation through some debugging that the touch event I receive from my ElementComponent
is in fact of type ElementTouchEvent
, and that touches contained within are of the DOM Touch
-type:

It turns out that element-input.js
in the engine just passes the native Touches it receives straight into a new ElementTouchEvent
rather than converting them:

Just for clarity, the constructor of ElementTouchEvent
doesn't convert the touches either.
I guess either the type definitions pulled from NPM are incorrect, or the touches should have been converted to the appropriate type so that the id
-field on touches can be used as expected.
Can someone please address this?
Thanks a bunch! 💪