Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular chart.js not resizing (shinking) in a flexbox

See the fiddle

https://jsfiddle.net/m942h0wm/6/

HTML

<div class="container" ng-app="app">
  <div class="main">
    <p>Main</p>
  </div>
  <div class="aside">
    <canvas class="chart chart-doughnut" 
        chart-data="[10,20,40]" 
        chart-labels="['one', 'two', 'three']">
    </canvas>
  </div>
</div>

CSS

.container {
  display: flex;
  flex-wrap: wrap;
}

.container>div {
  border: solid 10px;
}

.main {
  flex-grow: 2;
  flex-basis: 300px;
}

.aside {
  flex-grow: 1;
  flex-basis: 200px;
}

if you shrink the window so the layout pops to vertical, when you resize back up the layout doesn't pop back

has anyone else found this and solved it?

like image 974
Anthony Johnston Avatar asked Jan 05 '23 18:01

Anthony Johnston


1 Answers

I found the solution here

Flex items not shrinking when window gets smaller

min-width: 0;

on the items :)

like image 82
Anthony Johnston Avatar answered Jan 13 '23 11:01

Anthony Johnston