In Chrome for Android, bringing out the back-navigation arrow and then aborting the back navigation seems to change subsequent input event handling.
Steps to reproduce:
- Load any scene with an ArcRotateCamera (like this one). Make sure dragging orbits the target.
- Swipe in from right edge to initialize a back-navigation gesture, but abort it by then swiping right.
- Now try dragging the scene again to orbit. Instead it seems to zoom in and out.
Here’s a video of the issue: inputBug.mp4 - Google Drive
In our project, this also disables picking objects (using ray-casting), so it seems a bit like all input handlers are reset/deleted. Perhaps this is a Chrome and not a Babylon issue? Thankful for help!
Lemme take a look and see what’s going on. I suspect that this issue may be an issue with how we handle focus on Android, with respect to gesture initiation.
So here’s what I’ve found. When you first touch the screen, BJS registers it as a touch on the canvas. When the back gesture becomes active, the OS “interrupts” the touch and our code that handles a loss of focus never triggers (because a
blur event is never fired). When the back gets aborted, a new touch is registered and all input is treated as though there are two active touches. The fix for this would be listen for
pointercancel and handle it that way. I am currently testing this fix and will update when the PR is live.
Hi, did you have any luck with the fix? Otherwise, there’s a lot of people depending on a solution and we’re thinking of having a go at it ourselves. We’re unfamiliar with the architecture, though, so some kind of rough ETA would be of great help in our decision. Sorry to bother you!
Hey @antonjolsson, sorry about the delay in responding. For some reason I didn’t get a ping on this. I am working on this, my initial thoughts for the fix ended up not working so I’m trying to work on a different approach. Ideally, I’d like to have something ready and merged sometime early next week.
In the meantime, I’m going to directly assign this to myself so that I don’t miss any other messages.
Hey, no problems. Thanks for the fix, great work!