New issue
Advanced search Search tips

Issue 636325 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 633011
Owner: ----
Closed: Aug 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Compat



Sign in to add a comment

Absolutely positioned elements inside flex seems to not resolving their position properly

Reported by i...@stfoo.ru, Aug 10 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36

Example URL:
http://codepen.io/stfoo/pen/kXzPJJ

Steps to reproduce the problem:
1. Create element and set display to flex and flex-direction to column.
2. Fill this element with two other elements. Set their height to non-zero.
3. Put new element in between theese two and set it position to absolute.

What is the expected behavior?
Absolutely positioned element should be positioned on top of the next one.

What went wrong?
It either on top or bottom of parent element (depends on justify-content)

Does it occur on multiple sites: N/A

Is it a problem with a plugin? N/A 

Did this work before? Yes Chrome 51

Does this work in other browsers? Yes 

Chrome version: 52.0.2743.116  Channel: stable
OS Version: OS X 10.11.6
Flash Version: Shockwave Flash 22.0 r0

Code listing: http://codepen.io/stfoo/pen/kXzPJJ

html:
<div class="box">
  <div class="foo"></div>
  <div class="absolute">Text</div>
  <div class="bar"></div>
</div>

css:
.box {
  display: flex;
  flex-direction: column;
}

.foo, .bar {
  height: 100px;
}

.foo {
  background: #ccc;
  margin-bottom: 10px;
}

.bar {
  background: #acc;
}

.absolute {
  position: absolute;
}

In addition I checked that in Chrome 51, Safari 9.1.2 and Firefox 48.0. Everywhere except Chrome 52 it works as I expect it to.
 
Screen Shot 2016-08-10 at 14.28.00.png
66.5 KB View Download

Comment 1 by rsesek@chromium.org, Aug 10 2016

Components: Blink>CSS Blink>Layout>Flexbox
Components: -Blink>CSS
Mergedinto: 633011
Status: Duplicate (was: Unconfirmed)
This is due to a spec change, see https://drafts.csswg.org/css-flexbox/#abspos-items

See some discussion in  bug 633011 . This is not a Chrome bug. Hopefully, other browsers will update to this new behavior soon. Note that Edge has the same behavior as Chrome.

Sign in to add a comment