GUI : control.onPointerOutObservable() won't trigger on the border of the canvas

Hello :slight_smile:

I have an issue with any control of the BABYLON.GUI : when using the control.onPointerOutObservable, it won’t trigger when the control is on the border, and the mouse directly exits the canvas. Here is a repro of the issue :
mouseout

Playground
(Mouse the mouse, it will darken some rectangles on hover. When you exit the canvas, it won’t trigger the mouseout on the rectangle)

The only fix I could find is to add an html trigger canvas.addEventListener("mouseout", exit, false); (uncomment line 42 to test)

cc @RaananW

Forgot to update here - this PR solves the issue: Remove check for pointer out by RaananW · Pull Request #15255 · BabylonJS/Babylon.js (github.com)

1 Like

Very nice, it works :slight_smile:

Thanks @RaananW !


I have a big project based on GUI about to be released… Can’t wait to show you how much these GUI fixes are going to be usefull :grin:

1 Like

Can’t wait to see :slight_smile: