Pool not resized when element moved to its border

I’ve got a diagram with a bunch of elements created programmatically and it works as intended until I drag an element to a border. In that case only lane is resized and pool is left as it is.
There are no errors in the console and I’m not sure where to look. Could anybody please help?

image

As you can see, lane is bigger than the pool itself.

That diagram looks broken. How exactly are you creating it programmatically?

looks broken but it’s not :slight_smile:

Im creating them using modeling’s createShape and connect methods.

So I’ve found out what causes the issue. It comes from the fact that I forcefully assign the lane as the parent of the elements and so when I drop an element on any border then only the lane is resized.
Could you please provide the name of the module that is responsible for that behavior so I can customize it?

Continuing discussion from here, applying this fix in BpmnAutoResize module fixed my problem:

if (is(target, 'bpmn:Participant') || is(target, 'bpmn:Lane')) {
    this._modeling.resizeLane(target, newBounds, null, hints);
  } else {
    this._modeling.resizeShape(target, newBounds, null, hints);
  }