Giter Club home page Giter Club logo

Comments (6)

philipwalton avatar philipwalton commented on July 2, 2024

Do you know of a workaround?

from flexbugs.

rinick avatar rinick commented on July 2, 2024
this has bug: child_div's size could be measured incorrectly 
<div class='flex_layout'>
  <div class='div_with_flexgrow_or_stretch'>
    <div class="child_div"  style="width:50%;height:50%" />
  </div>
</div>

work around, this seems to work
<div class='flex_layout'>
  <div class='div_with_flexgrow_or_stretch'>
    <div style='position:absolute;left:0;right:0;top:0;bottom:0'>
       <div class="child_div"  style="width:50%;height:50%" />
    </div>
  </div>
</div>

from flexbugs.

rinick avatar rinick commented on July 2, 2024

test case
bug: http://jsfiddle.net/bj94y/2/
work around http://jsfiddle.net/bj94y/4/

from flexbugs.

gregwhitworth avatar gregwhitworth commented on July 2, 2024

I think this works at this point, but I don't think this will work once Chrome updates to the new part of the spec regarding absolute positioned children. I will test this on Monday since IE has already made this change and update this if it works or not. Here is the test case I will use to verify: http://jsbin.com/fowaxisupo/1/edit

from flexbugs.

wI2L avatar wI2L commented on July 2, 2024

Had to use your solution @rinick Thank you for the tip!
I will follow the issue for updated about this.

from flexbugs.

SimplGy avatar SimplGy commented on July 2, 2024

@gregwhitworth It's a good note and made me nervous, but rinick's workaround still fixes the problem, so long as my flex sized container is position: relative -- this follows the same rule as always about position: absolute only positioning against the nearest ancestor with non-static position.

<div class='flex_layout'>
  <div class='div_with_flexgrow_or_stretch' style='position: relative'>
    <div style='position:absolute;left:0;right:0;top:0;bottom:0'>
       <div class="child_div"  style="width:50%;height:50%" />
    </div>
  </div>
</div>

I'm wondering though if this will keep working or fail to work after Chrome updates. There are lots of "clarifications" to the spec around absolute positioning but I can't parse the intent. What's the static position of an absolutely positioned child element? https://drafts.csswg.org/css-flexbox/#change-201403-clarify

from flexbugs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.