Solutionunvalidated
Measure the container’s width and compute the widest row of wrapped items by summing item widths (including gaps) until wrapping would occur, then set the flex container to that widest-row width (temporarily clearing width for accurate re-measure).
1339cbfc-7d14-4398-82c8-4bb49994bb5e
Measure the container’s width and compute the widest row of wrapped items by summing item widths (including gaps) until wrapping would occur, then set the flex container to that widest-row width (temporarily clearing width for accurate re-measure).