I am facing an issue atm with the grid system. While I try to do some kanban style d&d system.
The issue is shown in the pic below.
Every card should be in a place as the arrows suggest.
Since the 2nd column is "empty" -> no cards in it yet, it's only have the padding applied to it.

Previously it was working well since everything was in the same col, and since the header(color indicated card) was in said col it'd have the correct width.
However I needed to separate the header since I'd like to implement some sticky behavior -> header should stay on top when we use vertical scroll.
The template looks like:
<div #autoscroll
class="col wholeTable">
<div class="row pipe-header">
<ng-container *ngFor="let stage of cardList; let i = index">
<div class="col">
<ng-container *ngIf="pipelineConfig.headerTemplate; else noHeaderForYou">
<ng-container
*ngTemplateOutlet="pipelineConfig.headerTemplate; context : {$implicit: headerList[i], count: cardList[i].items.length}">
</ng-container>
</ng-container>
<ng-template #noHeaderForYou>
<!-- Displaying some useful info even if no custom template is present-->
<dt-pipeline-header [label]="headerList[i].elementLabel"
[count]="cardList[i].items.length">
</dt-pipeline-header>
</ng-template>
</div>
</ng-container>
</div>
<div class="row stage">
<ng-container *ngFor="let stage of cardList">
<div class="col"
dragula="cardList"
[(dragulaModel)]="stage.items"
attr.id="{{stage.key}}">
<ng-container *ngFor="let item of stage.items">
<div class="card"
[ngClass]="{
'dragabble' : pipelineConfig.permissionChecker(item),
'nodrag': !pipelineConfig.permissionChecker(item)
}">
<div class="card-body">
<ng-container *ngIf="!pipelineConfig.permissionChecker(item)">
<span class="disabled-indicator"><i class="fas fa-ban"></i></span>
</ng-container>
<ng-container
*ngTemplateOutlet="pipelineConfig.bodyTemplate; context: {$implicit: item, showColumns: showContent}">
</ng-container>
</div>
</div>
</ng-container>
</div>
</ng-container>
</div>
</div>
component.css:
@media only screen and (max-width: 600px) {
.wholeTable {
display: block;
}
}
.stage {
word-break: break-word;
min-height: 100%;
flex-wrap: nowrap;
.col {
min-width: min-content;
}
}
.card.dragabble:hover {
cursor: grab;
}
.card.dragabble, .card.nodrag {
margin: 1rem 0rem;
}
.pipe-head-divider {
margin-bottom: 0;
}
.disabled-indicator{
display: flex;
float: right;
position: relative;
top: -0.5rem;
right: -0.5rem;
}
.wholeTable {
overflow-x: scroll;
overflow-y: hidden;
flex-wrap: nowrap;
}
.pipe-header {
flex-wrap: nowrap;
}
emptyto the col if there is no content and then usedisplay:noneon this column - yunzen