I need the first div to push the second to the right and so on, however, the width of the div stays the same after it has wrapped causing it to overlap.
Adding in a 100% width works but it makes the width for the smallest div the same as the largest leaving space either side.
The columns are mapped over like so:
{orderedColumns.map((column, index) => {
return (
<Column
key={index}
column={column}
/>
);
})}
<div style={{ display: "flex" }}>
<div
style={{
height: "60px",
display: "flex",
flexDirection: "column",
flexWrap: "wrap",
overflowX: "visible"
}}
>
<div>Test1</div>
<div>Test1</div>
<div>Test1</div>
<div>Test1</div>
<div>Test1</div>
</div>
<div
style={{
height: "60px",
display: "flex",
flexDirection: "column",
flexWrap: "wrap",
overflowX: "visible"
}}
>
<div>Test2</div>
<div>Test2</div>
<div>Test2</div>
<div>Test2</div>
<div>Test2</div>
<div>Test2</div>
<div>Test2</div>
<div>Test2</div>
<div>Test2</div>
<div>Test2</div>
<div>Test2</div>
<div>Test2</div>
</div>
<div
style={{
height: "60px",
display: "flex",
flexDirection: "column",
flexWrap: "wrap",
overflowX: "visible"
}}
>
<div>Test3</div>
<div>Test3</div>
<div>Test3</div>
<div>Test3</div>
<div>Test3</div>
</div>
</div>
Any ideas would be much appreciated.
Thanks.