PointerDragBehavior doesn't cancel drag when you mouse up outside the canvas

  1. Open https://playground.babylonjs.com/#1EBCJY#21 (or most any playground with a PointerDragBehavior).
  2. Drag the green box to the left, continuing off the canvas onto the code editor.
  3. Mouse up while still over the editor.
  4. Mouse over the canvas again.
    Result: drag continues as if the mouse button is still down.
    Expect: drag to be canceled.

Reproes with latest alpha, but not with 4.2, so it seems like this must have recently broken.

Lemme take a look and see what’s going on

Related issue it seems: Scale Gizmos When Cursor Goes Off/On Canvas

Thanks for pointing this one out to me, @Knar

I retested against 5.0.0-alpha.16, presuming that this PR was intended to fix this issue. Now the drag does get canceled in the above case, but it also cancels even if you don’t mouse up while outside the canvas bounds. So, new steps:

  1. Open https://playground.babylonjs.com/#1EBCJY#21 .
  2. Drag the green box to the left, continuing off the canvas onto the code editor.
  3. Mouse over the canvas again (with mouse button still down).
    Result: drag has been canceled, green box doesn’t continue moving.
    Expect: drag to continue.

Reproes in 5.0.0-alpha.16, but not with 4.2, in which the drag continues as expected.