viro icon indicating copy to clipboard operation
viro copied to clipboard

ViroButton - onClick doesn't trigger

Open danieldulcettiBN opened this issue 2 years ago • 5 comments

Requirements:

Please go through this checklist before opening a new issue

Environment

Please provide the following information about your environment:

  1. Development OS: Mac
  2. Device OS & Version: iOS 15.0.2
  3. Version: ViroReact 2.21.0 - React Native 0.65.1
  4. Device(s): iPhone Xr

Description

I'm using this wonderful library to achieve a treasure hunting: pratically, the user sees a 2D map where he is geolocated and, when he's near a treasure, start the ar mode where the app shows it as a ViroButton; clicking the button, the user can collect the treasure. Unfortunately, the onClick method doesn't work every time and it is possible that sometimes the event does not trigger, forcing the user to exit and enter again (sometimes it works, sometimes it doesn't work - maybe some reset).

I see some similar issues in viromedia's repository, but without solutions or with some workaround valid for that repository. I don't use last version of Viro, cause the error during installation talked in other issues.

Reproducible Demo

This is more or less my code of the ar mode, I cut the useless parts. https://pastebin.com/0bd9cqTj

Thanks to everyone!

danieldulcettiBN avatar Nov 04 '21 17:11 danieldulcettiBN

I've created a playground here to help with this issue.

I can reproduce this issue 😄 I see that swiping gives a much more consistent "click" than tapping the screen. I also find that onClickState tends to give a more accurate click event.

robertjcolley avatar Dec 18 '21 20:12 robertjcolley

Could this issue be raised to a higher priority? It is also happening with the ViroBox component.

francois-pasquier avatar Feb 07 '22 10:02 francois-pasquier

Yes. There seems to be issues with other events as well for different components.

From discord:

In my case, only onClick works, onRotate, onPinch never works, other events also do not work. Idk if it's caused by my device which is a Oneplus 7T Pro (Android 11), but i tried with other devices, all with android 11 (Poco X3 Pro, Oppo A54 and a Redmi Note 9S) and it also don't work.

robertjcolley avatar Feb 07 '22 12:02 robertjcolley

Any news on this?

Freitas98 avatar Apr 08 '22 18:04 Freitas98

Is there anything I can help with? Can someone give a hint where to start? We rely on this functionality very badly. I am willing to put some effort into it.

voydz avatar Aug 10 '22 11:08 voydz