elmarti / react-joystick-component

Tiny, multitouch, component driven joysticks in react
MIT License
86 stars 27 forks source link

Multi-touch support on default react webapp #34

Closed Bilal-chaf closed 2 years ago

Bilal-chaf commented 2 years ago

Hi !

I tried the component on a tablet, on a default react web app (not react-native), touch feature is very cool, amazing when it's used independently, but when i tried to touch another button, another place on the screen, or another instanced react-joystick-component, it returns to initial position or it struggles.

I was wondering if you plan to add multi-touch for this component ?

Have a nice day ! Thanks,

Example : ezgif-5-eacca7086a

elmarti commented 2 years ago

Thanks for the great demo!

I think part of the issue here is that we're assigning a singleton touchend and touchmove event to the window so it will trigger touchend on all components regardless of the particular touch, so the solution for this would be to check for a specific touch inside the handler which would solve the problem.

I'll carry out the following steps over the next few days:

elmarti commented 2 years ago

The base issue is now fixed, this doesn't solve the issue of zooming for double touches, this can be solved at the document level https://code-boxx.com/html-viewport-disable-pinch-zoom/

Hoping to find a solution for this in future

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 3.3.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket:

elmarti commented 2 years ago

@Bilal-chaf does this solve your problem?

Bilal-chaf commented 2 years ago

@Bilal-chaf does this solve your problem?

Amazing ! The problem is solved, thanks a lot, i tried with 2 joysticks at the same time, i tried touch combinations with tactile buttons i've made and the joystick, it's quite smooth. Multi-touch is working very well now !

Thanks for the quick fix.