For GUI control, "onPointerEnterObservable" won't trigger for the first time pointer entering in my React project

babylon-react-gui-binding-test (playcode.io)

This is my sample project for showing the problem I met.

There will be 2 marks I made with GUI. Hovering mouse on the mark will show React component at the mark’s position. Click elsewhere on the scene to hide it. After hiding the React component, onPointerEnterObservable only trigger at the 2nd time, this is the problem

cc @RaananW if he has an idea ?

1 Like

oh, that’s interesting. My general assumption is that the pointer-out is not triggered, so the element under pointer is locked in. I tried tinkering with it, but it is very hard (for me, at least) to debug the package code in playcode. However, you can solve this by using onPointerMoveObservable instead of onPointerEnter observable. Especially since you are hiding the element itself with the overlay, so no more pointermove events will trigger.

1 Like