So I've got a kind of header, that contains a heading and a bunch of buttons. These buttons can be added to, so it's important to me that they wrap properly.
The catch is that these buttons are fed in via angular as an outside component, and as such they get put in a div (I'm assuming?)
In this codepen I have illustrated the result I want to reach (blue) vs. what I'm getting (red). It's hard to see on the snippet so here is a link to a codepen. To be clear, I want the buttons to wrap individually, one by one, rather than as a group.
.flex-row {
display: flex;
flex-flow: row wrap;
}
.red {
background: red;
}
.blue {
background: blue;
}
<div class="flex-row red">
<h1>Really long annoying header goes here</h1>
<div>
<button>button</button>
<button>button</button>
<button>button</button>
<button>button</button>
<button>button</button>
<button>button</button>
<button>button</button>
</div>
</div>
<div class="flex-row blue">
<h1>Really long annoying header goes here</h1>
<button>button</button>
<button>button</button>
<button>button</button>
<button>button</button>
<button>button</button>
<button>button</button>
<button>button</button>
</div>
By the way, here is the component selection-buttons.component.html:
<button class="selectionbtn selectbtn" *ngFor="let btn of input.items;let idx = index" (click)="onSelect(idx)" [ngClass]="{'first': idx === 0, 'last': idx === input?.items?.length -1, 'active': currIndex === idx }" value="idx">{{btn.label | translate}}</button>
I made sure to remove the div they were being generated inside, which made me think that when gets called, they would just be generated inside the current div, but it doesn't seem to be the case.