-
-
Notifications
You must be signed in to change notification settings - Fork 78.9k
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
Fixes affix-top class not applying #15154
Conversation
Use scrollTop instead of colliderTop which uses the elements offset().top, as the offset top does not account for padding. This issue can be replicated by using a navbar-fixed-top and applying relevant padding to the body. (A navbar-static-top with no padding on the body does not encounter this issue) Fixes #15078
Is it possible to add a unit test for this? |
Thanks, much appreciated! |
Also fixes #15097. |
New unit test correctly fails with old code and passes with the proposed change, on PhantomJS. |
Running Sauce cross-browser tests: https://travis-ci.org/twbs/bootstrap/jobs/41276707 |
Sauce tests passed, although iOS had to retry a couple times, so we probably want to increase the setTimeout delays a bit, to prevent the test suite from becoming flaky. |
Retrying with 250ms delays instead of 0ms delays: https://travis-ci.org/twbs/bootstrap/jobs/41307952 |
LGTM. |
Use scrollTop instead of colliderTop which uses the elements
offset().top, as the offset top does not account for padding.
This issue can be replicated by using a navbar-fixed-top and applying
relevant padding to the body. (A navbar-static-top with no padding on
the body does not encounter this issue)
Fixes #15078