engine icon indicating copy to clipboard operation
engine copied to clipboard

Click event never fires in multi-touch scenarios

Open LeXXik opened this issue 3 years ago • 4 comments

Please, evaluate if it is a bug.

Currently, the click event never fires on an element input, if there is already another finger touching the screen.

https://github.com/playcanvas/engine/blob/3a9e881f2dff74923076ec4497929c11fffe2c15/src/input/element-input.js#L648-L664

The event.touches.length will be more than zero, skipping the block.

Repro project: https://playcanvas.com/project/961849/overview Touch the screen somewhere first, then while holding it, use another finger to tap the button.

LeXXik avatar Jul 23 '22 14:07 LeXXik

@jpauloruschel are you happy to take this one?

slimbuck avatar Jul 25 '22 08:07 slimbuck

The original design is to mirror what the browser does for raw inputs. So if the browser doesn't do a click event in the same scenario, then by original design, it isn't a bug

yaustar avatar Jul 25 '22 09:07 yaustar

I vote for it to be considered a bug. In many games we often use two fingers simultaneously for controlling the gameplay. If the browsers do it differently, I suppose, it is because it is not common to use 2 fingers to navigate a web page.

LeXXik avatar Jul 25 '22 16:07 LeXXik

Potentially related issue https://github.com/playcanvas/engine/issues/4341

yaustar avatar Jul 25 '22 16:07 yaustar

Completed as part of https://github.com/playcanvas/engine/pull/4562

jpauloruschel avatar Aug 25 '22 12:08 jpauloruschel