diff --git a/src/app/shared/object-grid/object-grid.component.ts b/src/app/shared/object-grid/object-grid.component.ts index c6f8347217..c4aaebed72 100644 --- a/src/app/shared/object-grid/object-grid.component.ts +++ b/src/app/shared/object-grid/object-grid.component.ts @@ -172,13 +172,18 @@ export class ObjectGridComponent implements OnInit { const result = []; + let index = 0; page.forEach((obj: ListableObject, i: number) => { - const colNb = i % nbColumns; - let col = result[colNb]; + + if (i % nbColumns === 0 && i > 0) { + index++; + } + + let col = result[index]; if (hasNoValue(col)) { col = []; } - result[colNb] = [...col, obj]; + result[index] = [...col, obj]; }); return result; } else {