material icon indicating copy to clipboard operation
material copied to clipboard

Possible Chrome 48 flexbox bug causing layout issues.

Open cah-ricksuggs opened this issue 10 years ago • 32 comments

I have been getting several reports of production defects, that seem to relate to flexbox bugs that have been introduced in Chrome version 48. I was not able to reproduce the issues until after upgrading to Chrome 48. After attempting to address some of the issues, I first found the Chrome changelog included several references to updates to scrollable areas. Then I discovered the following bug report: https://code.google.com/p/chromium/issues/detail?id=580196

One such issue that I am currently experiencing is that md-content elements appear to be expanding their parent elements and I am unable to scroll to the bottom when the window height is reduced.

The following codepen was taken directly from the angular material 1.0.3 demo page: https://material.angularjs.org/latest/demo/content

http://codepen.io/anon/pen/xZWOXX To reproduce the issue, I just resized the window until all of the text did not appear, and noticed that scrollbars do not appear and I cannot scroll the content.

cah-ricksuggs avatar Jan 25 '16 20:01 cah-ricksuggs

The core issue seems to be a requirement in Chrome 48 that flex sections be set to min-height: 0 and min-width: 0. We've been debugging this today as our browsers self-update and our layout breaks accordingly.

jmuharsky avatar Jan 25 '16 21:01 jmuharsky

Chromium Bug #546034 details the workaround and cause of this.

jmuharsky avatar Jan 25 '16 21:01 jmuharsky

@cah-ricksuggs, @jmuharsky - thx for this report and details. I will investigate immediately.

ThomasBurleson avatar Jan 25 '16 21:01 ThomasBurleson

@ThomasBurleson Great, thanks for the fast response time!

cah-ricksuggs avatar Jan 25 '16 22:01 cah-ricksuggs

FYI, we worked around this by overriding the flex attribute's behavior in our own project. Here is the relevant PR.

jmuharsky avatar Jan 25 '16 22:01 jmuharsky

If I understand it right, setting min-height: 0 or max-height: 0 is specifically necessary when flex-base is zero, as it is by default for an unadorned "flex" property. It should not be necessary for a nonzero flex-base.

klausw avatar Jan 25 '16 23:01 klausw

I experienced this issue while having a child element with

overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

For now it works changing to different stylesheet.

dohomi avatar Jan 26 '16 02:01 dohomi

I have updated to the last version and I have the same problems.

The images are seen with a taller hight.

image

The correct result has to be..

image

I hope that errors can be solved.

Thank you so much, and sorry for my bad English.

sky10p avatar Jan 29 '16 08:01 sky10p

@sky10p try this as a workaround :

.YourImages {
  min-height: 0;
}

It worked for me.

ValentinCreative avatar Jan 29 '16 10:01 ValentinCreative

Had the same issue, Child div with ellipsis css.

overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;

pradeep330 avatar Feb 01 '16 09:02 pradeep330

Still got the bug after upgrading to 1.0.4 on Chrome 48. I have to put min-height: 0; to almost all element (md-card, md-card-content, md-card-title, ...) The behaviour is very weird because if i add min-height: 0; on the debug console on chrome it will work and calculate the height correctly but if i remove min-height: 0; after that is still correctly calculate the height...

Firefox 43 with Angular Material 1.0.4 capture d ecran 2016-02-01 a 11 50 56

Chrome 48 with Angular Material 1.0.4 capture d ecran 2016-02-01 a 11 50 41

Thanks

GautierT avatar Feb 01 '16 10:02 GautierT

Add flex="none" Overflow-x:auto and text-overflow:ellipsis not working in chrome 48

pradeep330 avatar Feb 01 '16 11:02 pradeep330

@pradeep330 : flex="none" working great !

GautierT avatar Feb 01 '16 12:02 GautierT

@GautierThiriez : :)

Add flex="none" for non flex div.

And Fix for overflow-x: add style width:any value. i added zero like below.

`

overflow will get scroll bar

`

pradeep330 avatar Feb 01 '16 12:02 pradeep330

@pradeep330 : Hum.. It will be a nice afternoon to find all non flex div and add flex="none"... ! Thanks a lot for the fix.

GautierT avatar Feb 01 '16 13:02 GautierT

I am running into Chrome 48 flexbox issues as well at http://jpdevries.github.io/eureka/examples/ but have confirmed my layout works fine in Chrome Canary v50 :(

jpdevries avatar Feb 01 '16 17:02 jpdevries

Thanks @jmuharsky Your solution works.

hourliert avatar Feb 01 '16 20:02 hourliert

flex="none" working great for non flex elements as mentioned by @pradeep330 and @GautierThiriez. saved me a lot of time with this temp fix. thanks!

JSOdin avatar Feb 03 '16 05:02 JSOdin

min-height: 0; seems to work. Thanks.

donaldpipowitch avatar Feb 03 '16 13:02 donaldpipowitch

min-height: 0; saved me. Thanks!

LuudJacobs avatar Feb 05 '16 16:02 LuudJacobs