Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

div.row > div.six.columns (or other sizes) doesn't seem to break to block (100%) on Safari iOS #8

Open
icaroscherma opened this issue Jan 25, 2020 · 7 comments

Comments

@icaroscherma
Copy link

I designed / coded a page and in Chrome it's fine (tested using the responsive mode, aka device toolbar), but when I use on my actual phone, the div.row > div.six.columns doesn't seem to ocupy 100% of the width, breaking the whole viewport :( is it because of the @media queries using ppi instead of pixels? ( @media only screen and (max-resolution: 119dpi) and (min-resolution: 91dpi), not all html )

@robsheldon
Copy link
Owner

Hmm. Can you post a small example with this behavior? I'll add it to the CBT tests and figure out what's going on.

@icaroscherma
Copy link
Author

This is the preview on chrome using responsive mode iPhone 8 Plus:
Screen Shot 2020-01-27 at 1 21 42 PM

This is the actual phone:
photo_2020-01-27_13-23-26

Basically it's div.container.row with styles being .container { max-width: 100rem; margin: 0 auto; } and inside I have div.column > iframe (also tried with div.seven.columns but nothing changes) and another div.five.columns > p (no custom stylings on .column / .columns .

For me it seems that the grid sizing is tied to the ppi of the screen instead of the actual resolution, or maybe it's a particular bug with iOS.

@icaroscherma
Copy link
Author

@robsheldon could you test it on Android or you had this behavior before?

@robsheldon
Copy link
Owner

I hadn't seen this behavior in previous device tests. I suspect there's some combination of html and the css that's causing this. I need to figure out the html part. I'll make time for it tomorrow at the latest.

@icaroscherma
Copy link
Author

@robsheldon to me it's an @media issue, more specifically @media (min-width: 40rem) the .row and .column being handled.

Even the official website has the same (bugged) behavior.

Chrome on Responsive Mode:
Screen Shot 2020-02-14 at 3 57 19 PM

Real iPhone 8 Plus (tried Safari, Chrome, etc):
IMG_3104

@icaroscherma
Copy link
Author

icaroscherma commented Mar 3, 2020

Seems to be an iOS issue as I said, ported from Miligram ( milligram/milligram#136 ).

My fix was replacing the rem to px as below:

@media screen and (max-width: 639px) {
  .row {
    flex-direction: column;
  }
  .column, .columns {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}

Edit:
You can change the min-width: 40rem to 45rem but do some testing on iOS simulator ;)

@robsheldon
Copy link
Owner

Thank you for doing so much leg-work on this issue. I do want to fix it, my hang-up has been on finding the right approach for it.

The media queries are given in rem units to help improve support for environments with scaled displays -- some people with poor eyesight may have browser options set to scale things and using rems supports that better than px.

I'm reluctant to just bump the max-width on that media selector from 40 to 45rem because there are still going to be a handful of handheld devices with this behavior.

I think the right thing to do is to switch to using device-width and pixels, but that's not a change I want to make in a point update.

So, I'm going to do a bugfix release for the other two bugs that have been reported, and then see if changing up the media queries is going to break anything. If not, I'll do a minor release with that fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants