title: Overflow auto is not working with flex container
body: <p>I'm trying to make a simple chat window where the messages are anchored to the right, and bottom of the window. I want the chat window to scroll when messages overflow out of the window.</p>
  
  <p>I'm using flexbox to position the messages, and giving the window an <code>overflow-y: auto;</code>. For some reason that I cannot understand this does not work. If I remove the flex positioning off the window, scrolling works normally and as expected. Why is flexbox changing the scroll behavior?</p>
  
  <p>Here's a very simple codepen that shows the problem:
  <a href="https://codepen.io/skypod/pen/OdavbR" rel="nofollow noreferrer">https://codepen.io/skypod/pen/OdavbR</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.chat-window {
    background-color: grey;
    width: 400px;
    height: 400px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-end;
    overflow-y: auto;
  }
  
  .message {
    background-color: blue;
    color: white;
    padding: 0.5rem;
    margin: 0.25rem;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;div class="chat-window"&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
    &lt;div class="message"&gt;text&lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>