Please provide the following information about your environment:
The onClick event sometimes doesn't fire on an ImageMarker or any content contained in an image marker. But, clicking below the image marker and it's content or most often, down and right fires the event. I've tried any number of nesting objects and moving the click handler around, but can't get onclicks to work all of the time. It seems to always work if I switch the event to hovering or dragging.
My image markers are remote image URLs. Not sure if that is part of the issue. I prefetch them in react, but not sure if that caching carries over.
I feel like it may have to do with PixelRatio not initializing correctly because of a race condition or something. I tried using performARHitTestWithPoint but there's no way to tell if the hit test touched an image marker unless I'm missing something.
Hi @Vednus, did you manage to find any workaround ? I'm encountering the same strange behavior.
Hey @teabow yeah, I figured out that it was a bug in the Viro/virocore package. I made a fix, but didn't put up a pr because I think my fix only works if you're using the entire screen for the AR and not a part of it. You can see the relevant changes in the VROViewAR.mm file here.
https://github.com/Vednus/virocore/compare/master...sl/fix/ios-tap-fix
But, you'll need to setup the viro repo and virocore repo in the same directory and go through the build steps for virocore that are outlined in their README to get it to work.
Thanks a lot @Vednus i'll try that !
Did your full screen AR scene was part of a navigation stack ? I'm using react-navigation and I'm wondering if I will have to change the way of navigating to the scene.
@teabow mine is visually in a react-navigation stack, but because of all the workarounds I was trying and some other funky stuff, it is a component in a tab bar. But, I load a black page in the navigation stack and then show the ARView, so the user thinks it's embedded in the stack.
Hey @teabow yeah, I figured out that it was a bug in the
Viro/virocorepackage. I made a fix, but didn't put up a pr because I think my fix only works if you're using the entire screen for the AR and not a part of it. You can see the relevant changes in theVROViewAR.mmfile here.
Vednus/[email protected]/fix/ios-tap-fixBut, you'll need to setup the viro repo and virocore repo in the same directory and go through the build steps for virocore that are outlined in their README to get it to work.
Thanks, it work for me.
I rebuild this and upload in https://github.com/developBeetSoftD1/react-viro. Hope to be of help to someone here
Most helpful comment
Hey @teabow yeah, I figured out that it was a bug in the
Viro/virocorepackage. I made a fix, but didn't put up a pr because I think my fix only works if you're using the entire screen for the AR and not a part of it. You can see the relevant changes in theVROViewAR.mmfile here.https://github.com/Vednus/virocore/compare/master...sl/fix/ios-tap-fix
But, you'll need to setup the viro repo and virocore repo in the same directory and go through the build steps for virocore that are outlined in their README to get it to work.