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

Affix flickering on iOS 8.2 #16198

Closed
maikokuppe opened this issue Apr 1, 2015 · 10 comments
Closed

Affix flickering on iOS 8.2 #16198

maikokuppe opened this issue Apr 1, 2015 · 10 comments
Labels

Comments

@maikokuppe
Copy link

If I touch the screen in order to scroll down, while the navigation bar is not yet at the upper edge of the view (it's below it), and I'm scrolling down such that the original navigation bar position moves out of sight (still touching the screen), this is the moment the flickering starts.

The line js/affix.js:53 is the reason for this issue:

var colliderTop = initializing ? scrollTop : position.top

Why not replace it by

var colliderTop = scrollTop

? This way it works fine.

@pierrebeitz
Copy link

+1

@zacechola
Copy link

Would you mind posting a jsbin or jsfiddle showing an example of this?

@cvrebert cvrebert added the js label Apr 1, 2015
@cvrebert
Copy link
Collaborator

cvrebert commented Apr 1, 2015

Check the git blame for that line and you should be able to find out what made that ternary necessary.

@cvrebert cvrebert changed the title Topnav flickering on iOS 8.2 Affix flickering on iOS 8.2 Apr 1, 2015
@maikokuppe
Copy link
Author

The code in question was committed here:
8c0eb9b

There is no explanation given on why scrollTop is just used once for initialization and position.top otherwise.
Until this change, only scrollTop was used (as I proposed in the first comment).

@cvrebert
Copy link
Collaborator

cvrebert commented Apr 8, 2015

@charlesbjohnson Do you happen to recall the reason for the initializing logic here?

Interestingly, making the suggested change doesn't break any unit tests in any browser.

@charlesbjohnson
Copy link
Contributor

@cvrebert making the change wont' break any tests because there aren't any unit tests. This could only be tested visually.

I can't recall the exact reasoning behind the initializing logic right now but it was for affixes that fix to the bottom of the viewport for pages with dynamic height. If you are going to make any changes to it then please visually test both types of affixes. Additionally, when testing the bottom affix please also make sure it is not flickering or jumping when the document height changes. The visual test has all of this already set up.

Take a look at the PR I made last year. In the diff comments there are some gifs and other explanations.

@Glark
Copy link

Glark commented May 27, 2015

The above fix solved my iOS affix flicker issues too.

@nuttt
Copy link

nuttt commented Aug 14, 2015

I've tested on iOS 8.4 and it works when using affix with top-fixed navigation bar.

@cvrebert cvrebert added the v3 label Aug 19, 2015
@a2f0
Copy link

a2f0 commented Nov 28, 2015

This fix is a gift. Thank you.

@mdo
Copy link
Member

mdo commented Sep 5, 2016

Bootstrap 3 is no longer being officially developed or supported.

All work has moved onto our next major release, v4. As such, this issue or pull request is being closed as a "won't fix." For additional help and support, we recommend utilizing our community resources. Thanks for your understanding, and see you on the other side of v4!

<3,
@mdo and team

@mdo mdo closed this as completed Sep 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants