philipwalton / flexbugs

A community-curated list of flexbox issues and cross-browser workarounds for them.
MIT License
13.63k stars 495 forks source link

Safari/Chrome: Height of overflow-hidden item in flex item in absolute flexbox container #198

Open rebornix opened 7 years ago

rebornix commented 7 years ago

I have following simple HTML snippet which has different result in Chrome and Safari

<body>
  <div id="1" style="position: absolute; display: flex; flex-direction: column; /* height: 78px; */">
    <div id="2" style="height: 100%; display: flex; flex-direction: column;">
      <div id="3" style="position: relative; overflow: hidden;">
        <p><span>CSS</span></p>
      </div>
    </div>
</div>

The content is shown perfectly in Chrome while in Safari, #3 height is 0. But if I do one of following

then the height of all elements are calculated correctly in Safari.

philipwalton commented 7 years ago

Can you create a CodePen demo? When I load your HTML I don't see the issue.