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:
Drag the green box to the left, continuing off the canvas onto the code editor.
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.
The behavior seems to have changed again in 5.0.0-alpha.17. Now the drag-out-and-back behaves as expected the first time, but not on subsequent drags. Full steps:
Drag the green box to the left, continuing off the canvas onto the code editor.
Mouse over the canvas again (with mouse button still down).
Result: drag continues, as expected.
Mouse up.
Drag the green box in the same way as before (off the canvas and back on).
Result: drag cancels as soon as you leave the canvas.
Expect: drag to continue if you keep the mouse button down, as in Babylon 4.2.
Iâm thinking that a change may need to be made to handle the logic for held pointer clicks when the leave the canvas area. As it stands now, when the input leaves the canvas, all pressed pointer buttons are treated as though a pointerup event was created. I think what may need to be done is to extend the context of the pointer input to the window and explicitly handle how the input is interpreted when in the context of the window but not the canvas. Iâm still working on a way to accomplish this that isnât effectively âreinventing the wheelâ with the DeviceInputSystem.
May I suspect that this has regressed with this PR?
As @PolygonalSun is author of both PR, I donât think you overlooked the issue, but the pointerUp event outside the canvas does not fire for me.
When you say that youâre not having the pointerup event outside of the canvas, are you saying that your drag isnât releasing? If so, what browsers/OS are you seeing this with?