question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect flexbox autoprefixing in iOS

See original GitHub issue

Version

2.0.0-4

Reproduction

I was testing an app in Browserstack with the following configuration:

  • iPhone 6S+
  • iOS 8
  • Safari browser

There was a bug present due to incorrectly prefixed flexbox code. iOS 8 requires -webkit prefixing for flexbox: http://caniuse.com/#feat=flexbox.

My original CSS:

const Wrapper = styled.div`
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
`;

Styled-components turned that block of CSS into the following when loaded on the iOS device:

display: -webkit-box;
display: -webkit-flex; <-- this worked as expected
display: flex;
justify-content: flex-end; <-- Safari disabled this as an invalid style
-webkit-box-align: flex-end; <-- Safari disabled this as an invalid style
align-items: flex-end; <-- Safari disabled this as an invalid style

The correct styling should have been:

-webkit-justify-content: flex-end;
-webkit-align-items: flex-end;

Steps to reproduce

I’m not sure of an easy way to provide a replication for this issue because it requires being run on an actual iOS device. Chrome emulation will not replicate the issue. The CSS blocks above should illustrate the problem well enough.

Expected Behavior

The autoprefixer would apply the correct -webkit autoprefixed styles that iOS 8 requires.

Actual Behavior

Some styles appeared to be autoprefixed with the old Flexbox spec, while others were not autoprefixed at all.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
lnmunhozcommented, Dec 15, 2017

@ryanheathers I’m still having issue with the prefixes… I updated to styled-components@next but still not working.

How did you manage to fix?

1reaction
ryanheatherscommented, Apr 2, 2017

👍 thanks for the quick fix! Really enjoying using your great lib and appreciate the responsiveness of the maintainers.

Read more comments on GitHub >

github_iconTop Results From Across the Web

flexbox not working (ordering) on iOS - Stack Overflow
It's not working because you're missing the -webkit prefix on order , which is still required in all versions of Safari & iOS...
Read more >
Is Vendor Prefixing Dead? - CSS-Tricks
Let's take a quick stroll down memory-lane to revisit how vendor prefixing CSS properties came to be. I hope I don't trigger PTSD...
Read more >
Say Goodbye to Vendor Prefixes
In this article, I'll show you how this dream can become reality with a tool called Autoprefixer.
Read more >
Backwards compatibility of flexbox - CSS - MDN Web Docs
This guide will help you in those cases where you do come across an issue or have the requirement to support older browsers....
Read more >
IOS CSS Flexbox Issue - SitePoint
Hi guys Was wondering if there was anybody with IOS/Flexbox ... You have disguised that problem by hiding the overflow on the body...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found