Bpmn autoplace places nodes on top of existing nodes

Hello,

We have a UI project that makes use of bpmn-io js to bring up a modeler and canvas that lets user create workflows.
We have a feature wherein we are making use of the autoplace feature from bpmn-js.

image

Autoplace on the task places nodes over other nodes.

image

Appreciate if someone can guide me on how to solve it.

It looks like a bug in the module, so it would be great if you opened an issue in bpmn-js repo, describing the problem with steps to reproduce.

If you want to help us with the fix (or even work on it yourself), try to reproduce this problem with a test case.