Safari position:fixed not compatible with push/pull columns #16814

Closed
enbo opened this Issue Jul 13, 2015 · 11 comments

3 participants

@enbo
enbo commented Jul 13, 2015

Objects with position: fixed do not get pulled or pushed like they should be when col-xs-push-6 or any other pull/push classes are used when viewing in iOS 8.4 Safari. This is not an issue in Explorer, Chrome, Opera, or Firefox to my knowledge.

You can see that the paragraph with "affix" is not pushed to the right like it should be in the example below. Depending on the viewport, the paragraph may be covered by the background color of the left column, since it comes later in the HTML.

http://jsbin.com/kuzenonexe/1/edit?html,css,output
http://jsbin.com/dakenacazi/1/edit?html,css,output

HTML:

<div class="container-fluid">
    <div class="row">
        <div id="pushed-col" class="col-xs-push-3 col-xs-9">
            <p>
                This is a paragraph.
            </p>
            <p class="affix">
                This is a paragraph with "affix". In a desktop browser, you can scroll to verify that its position is fixed.
            </p>
            <div class="extended-col">
            </div>
        </div>
        <div id="pulled-col" class="col-xs-pull-9 col-xs-3">
            <p>
            This is a paragraph from a column lower in the document.
            </p>
            <div class="extended-col">
            </div>
        </div>
    </div>
</div>

CSS:

#pulled-col {
  background-color: #ee9999;
}
#pushed-col {
  background-color: #99eeee;
}
.extended-col {
  display: block;
  content: "";
  height: 100vh;
}
@cvrebert cvrebert added the css label Jul 13, 2015
@cvrebert
Bootstrap member

Your .col-*s need to be children of a .row, which in turn needs to be a descendant of a .container or .container-fluid. Dunno whether that affects your issue though.

@enbo
enbo commented Jul 14, 2015

Thanks, cvrebert. It doesn't fix the issue, but I've corrected the HTML.

@cvrebert
Bootstrap member

I'm not sure what CSS dictates is supposed to happen if you just set position: fixed without any left/right/top/bottom like that (perhaps @mdo can enlighten me), but I can confirm that both iOS 8.4 Safari and OS X Safari 8.0.7 behave differently from IE11, Firefox, and Chrome on http://output.jsbin.com/yuxebo/2

Safari screenshot:
safari desktop

Chrome screenshot for comparison:
chrome

@cvrebert cvrebert changed the title from iOS 8.4 position fixed not compatible with push/pull columns to Safari position:fixed not compatible with push/pull columns Jul 24, 2015
@cvrebert
Bootstrap member
@cvrebert
Bootstrap member

Filed Apple Safari Radar problem: http://openradar.appspot.com/21993128

@cvrebert cvrebert added a commit that referenced this issue Jul 25, 2015
@cvrebert cvrebert Add Wall of Browser Bugs entry for #16814
Closes #16814
[skip sauce]
ec0cf58
@cvrebert cvrebert closed this in d24559d Jul 25, 2015
@cvrebert
Bootstrap member

There is now a test for this in the W3C CSS WG test suite: w3c/csswg-test#813

@cvrebert cvrebert added a commit that referenced this issue Jan 7, 2016
@cvrebert cvrebert https://webkit.org/b/147284 has been fixed
Refs #16814
[ci skip]
6ab9e10
@cvrebert cvrebert added a commit that referenced this issue Jan 7, 2016
@cvrebert cvrebert Port 6ab9e10 to v3
https://webkit.org/b/147284 has been fixed
Refs #16814
[ci skip]
9be8428
@enbo
enbo commented Jun 4, 2016

Hm, I don't think it's actually been fixed yet. I looked at your test (https://bug-147284-attachments.webkit.org/attachment.cgi?id=268137) and it fails on Safari Version 9.1.1 (11601.6.17).

Thanks for passing this bug to the WebKit team!

@cvrebert
Bootstrap member
cvrebert commented Jun 4, 2016

@enbo It's fixed in the current Safari Technology Preview. So the fix should be shipped in the next stable Safari release.
Protip: Test using the current WebKit Nightly in the future, rather than stable Safari.

@enbo
enbo commented Jun 4, 2016

Ah, I see.
Thanks for the tip! I'm still very new to bug reporting/testing.

@jonathanmelville

Does anyone know if there is a known workaround to this problem?

I have tried all of the usual Safari hacks (transform: translateX(0) to no avail. Would love to know if anyone has been able to fine a reliable workaround to this problem.

Can confirm this has been fixed in the latest tech preview but that doesn't really help for now.

@cvrebert
Bootstrap member

Set a non-auto value for the left or right property if possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment