OnPointerDown & OnPointerUp are not called at the right moment

I would like to be notified when my XR Ray Interactor (XR Interaction Tookit) press down and press up a button.

First issue: OnPointerDown & OnPointerUp are called when Button is released.
→ Actually not but I was fooled by the the Meta Quest Developer Hub logs.

Second issue: For some reason when my target is a Button when I press down the OnPointerUp event is also raised.
→ I selected another UI element on the OnPointerDown event.

Edit solution:

I managed to get the down and up event, I have 3 solutions :

  1. by creating a custom Button, inheriting Button Monobehaviour, and overriding OnPointerDown and OnPointerUp.
  2. by adding the Event trigger component.
  3. by subscribing to the UIInputModule.pointerDown or UIInputModule.pointerUp events.

Solution:

After more tests I found out the Meta Quest Developer Hub logs are not realtime (there is a delay). So in my test my log for the onPointerDown was display when I released the input.

My issues was that on the down callback I selected another UI element. In editor, with my mouse I didn’t have that issues but with XR Interaction Toolkit in built I have.