# Diagram group covers a box that is not in it: how to fix it

The message means a group's dashed area covers a block outside the group, so the block looks like a member.


```json
{"title": "Bookshop orders",
 "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Checkout"]}],
             [{"id": "pay", "title": "Card payments", "tiles": ["Card checks"]}],
             [{"id": "orders", "title": "Order service", "tiles": ["Orders"]}]],
 "groups": [{"label": "Our own systems", "members": ["shop", "orders"]}],
 "links": [{"from": "shop", "to": "pay"}, {"from": "pay", "to": "orders"}]}

```

![Bookshop orders](https://open-diagram.dev/images/pages/problems-group-covers-a-box-1.svg)

The check: 1 layout problem(s)

```text
group 'Our own systems' overlaps 'pay', which is not in it; add it to the group or move it
```


## Why does it happen?

A group is one rectangle drawn around all its members, so a block between them falls inside. The rectangle reaches 20 px past the members on each side, with a row for the title on top. The check compares it with every block that is not a member.

In the `columns` layout, a group around the first and third columns covers the second.

## How do I fix it?

Make the picture match the group's list of members.

1. If the block belongs in the group, add its id to the group's `members`, or in Python to the list passed to `d.group()`.
2. If it does not, place the members next to each other, in one column or in neighbouring columns.
3. Put the other block outside the group's area.
4. Run the check again.

Here `shop` and `orders` share the first column, and `pay` moves to the second. The check reports 0 layout problems:


```json
{"title": "Bookshop orders",
 "columns": [[{"id": "shop", "title": "Online shop", "tiles": ["Checkout"]},
              {"id": "orders", "title": "Order service", "tiles": ["Orders"]}],
             [{"id": "pay", "title": "Card payments", "tiles": ["Card checks"]}]],
 "groups": [{"label": "Our own systems", "members": ["shop", "orders"]}],
 "links": [{"from": "shop", "to": "pay"}, {"from": "pay", "to": "orders", "start": "auto", "end": "auto"}]}

```

![Bookshop orders](https://open-diagram.dev/images/pages/problems-group-covers-a-box-2.svg)

The check: 0 layout problems


The line from `pay` back to `orders` now runs right to left, so it takes `auto` sides. Without them, the check reports that the line leaves `pay` facing away from `orders`.

Updated November 25, 2026. Web page: https://open-diagram.dev/problems/group-covers-a-box.html

See also:

- [Diagram boxes too close or overlapping: how to fix it](https://open-diagram.dev/problems/boxes-too-close.md)
- [Line label covers a group title: how to fix it](https://open-diagram.dev/problems/label-covers-group-title.md)
- [Arrow leaves or enters a box on the wrong side: how to fix it](https://open-diagram.dev/problems/arrow-on-the-wrong-side.md)
