Repeater collapse all items except one

I have this repeater with collapsed boxes inside, when I hit the blue + the box expands and so on, but I want all boxes to be collapsed except for the one that was clicked.

There’ll be X number of items in the repeater.

I tried this but doesn’t work

let $item = $w.at(event.context);

if($item('#group180').collapsed)  {
    $w('#group180').collapse();
    $item('#group180').expand();
else {
    $w('#group180').collapse();
}

Use onItemReady event. That event is fired for each item on repeater filling. Use the $item selector instead $w on event code.