Event has no pointerId in 4.2.0-alpha.27

Hello guys,

I’m testing the new version (upgrading from "@babylonjs/core": "4.1.0" to 4.2.0-alpha.27, and noticed an API change that I wasn’t expecting.

When using: scene.onPrePointerObservable.add the event.event.pointerId is undefined on safari desktop (I guess that it might be undefined on different browsers as well) the pointerId is used to identify the “finger” in multi-touch screens.
The only change I made was upgrading babylon version and then I noticed the bug.

I would very much appreciate your help in this matter.

Let me check that…

1 Like

The main thing we change was relying on mouse vs pointer events on Safari due to their latest updates. Hope that might help you @Cedric.

The thing is there is no touch screen on safari desktop so no multitouch :slight_smile:

I’m not sure if there are any plans on implementing multi touch APIs for desktops (trackpads for instance) if not I think it will be better to at least set the pointerId to 1 for backward compatibility.
thanks a lot :slight_smile:

Yes, that’s my guess. Preserve compat with a valid pointerid

Hi @Cedric any news?

It’s on my task list. I’ll do it hopefully first days of next week.

That’s awesome, thanks a lot!

PR pointerid compatibility for Safari by CedricGuillemet · Pull Request #8670 · BabylonJS/Babylon.js · GitHub

1 Like

Merged!

this is happening for more then Safari

    at HTMLCanvasElement._onPointerMove (babylon.js:16)

On my chrome browser as well.

With this new PR fix that also?

1 Like

Hi. problem still there on chrome in v4.2.0-alpha.28 программа для Web - скриншотов

I think there’s a problem with the PR, here’s another one that should fix the problem:

Hi all,

I’m not sure if such quick fix lead to some other issues here. But I did encounter the error today…
When I use <script src="https://preview.babylonjs.com/babylon.js"></script> in my demo, there’s an error when loading.

Uncaught TypeError: Cannot assign to read only property ‘pointerId’ of object ‘#’
at HTMLCanvasElement._onPointerMove (babylon.js:16)

If I replace the preview version with <script src="https://cdn.babylonjs.com/babylon.max.js"></script>, the error is gone.

This is fixed by the PR above (not deployed yet, though).

Deployed to npm already with alpha 29

1 Like