bpmn-io / bpmn-js

A BPMN 2.0 rendering toolkit and web modeler.
https://bpmn.io/toolkit/bpmn-js/
Other
8.52k stars 1.31k forks source link

Moving elements beyond the border of a pool is possible when moving it outside the viewport #2210

Open StefanLerch opened 1 month ago

StefanLerch commented 1 month ago

Describe the Bug

Restricting the movement of an element inside the "RulesProvider" module can be bypassed by moving an element outside the viewport. With this, it is for example possible to stack pools on top of each other, see GIF.

Steps to Reproduce

  1. Create a new model with two pools
  2. Moving the pools on top of each other does not work
  3. Move the viewport so that one pool is barely visible
  4. Now move the second pool beyond the viewport, on top of the other pool
  5. The pool can be dropped, even though it is normally not possible

Result: The pools can be stacked on top of each other.

Or:

  1. Create a new model with a pool
  2. Create a Startevent inside of it
  3. Try to move the element outside the pool's border
  4. Now move the element beyond the viewport

chrome_SU1NUSx2UP

Result: The element is moved to the position. Even though the pool increases its size afterward to contain the element, I would still argue that this is not intended behavior because moving the element beyond the border of the pool is otherwise restricted.

Expected Behavior

The current viewport should be considered when moving elements. Locally, I could fix this by preventing any movement beyond it. In the case provided above, I would expect, that I am unable to move the element beyond the viewport. The pool should only increase in size if I drop the element close to the edge of the pool, but not far beyond its borders.

Environment

barmac commented 1 month ago

Thanks for reporting this.

I've tested a similar interaction in Excalidraw and Miro, and both of them allow to move the element past the viewport if one is fast enough.

The problem of extending the participant by far via this trick looks like a bug to me as well. I wouldn't deem it critical though.