{"action":"created","issue":{"url":"https://api.github.com/repos/twbs/bootstrap/issues/15593","labels_url":"https://api.github.com/repos/twbs/bootstrap/issues/15593/labels{/name}","comments_url":"https://api.github.com/repos/twbs/bootstrap/issues/15593/comments","events_url":"https://api.github.com/repos/twbs/bootstrap/issues/15593/events","html_url":"https://github.com/twbs/bootstrap/pull/15593","id":54663146,"number":15593,"title":"Handle multiple zero-offset Scrollspy elements.","user":{"login":"neoeno","id":1007202,"avatar_url":"https://avatars.githubusercontent.com/u/1007202?v=3","gravatar_id":"","url":"https://api.github.com/users/neoeno","html_url":"https://github.com/neoeno","followers_url":"https://api.github.com/users/neoeno/followers","following_url":"https://api.github.com/users/neoeno/following{/other_user}","gists_url":"https://api.github.com/users/neoeno/gists{/gist_id}","starred_url":"https://api.github.com/users/neoeno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neoeno/subscriptions","organizations_url":"https://api.github.com/users/neoeno/orgs","repos_url":"https://api.github.com/users/neoeno/repos","events_url":"https://api.github.com/users/neoeno/events{/privacy}","received_events_url":"https://api.github.com/users/neoeno/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/twbs/bootstrap/labels/js","name":"js","color":"ffc40d"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/twbs/bootstrap/milestones/30","html_url":"https://github.com/twbs/bootstrap/milestones/v3.3.4","labels_url":"https://api.github.com/repos/twbs/bootstrap/milestones/30/labels","id":927525,"number":30,"title":"v3.3.4","description":"Skipping over v3.3.3 due to\r\nhttps://github.com/twbs/bootstrap-sass/commit/107ca189e406bbe314eb84f0372ed3706b81c761","creator":{"login":"cvrebert","id":419884,"avatar_url":"https://avatars.githubusercontent.com/u/419884?v=3","gravatar_id":"","url":"https://api.github.com/users/cvrebert","html_url":"https://github.com/cvrebert","followers_url":"https://api.github.com/users/cvrebert/followers","following_url":"https://api.github.com/users/cvrebert/following{/other_user}","gists_url":"https://api.github.com/users/cvrebert/gists{/gist_id}","starred_url":"https://api.github.com/users/cvrebert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cvrebert/subscriptions","organizations_url":"https://api.github.com/users/cvrebert/orgs","repos_url":"https://api.github.com/users/cvrebert/repos","events_url":"https://api.github.com/users/cvrebert/events{/privacy}","received_events_url":"https://api.github.com/users/cvrebert/received_events","type":"User","site_admin":false},"open_issues":41,"closed_issues":109,"state":"open","created_at":"2015-01-08T19:01:33Z","updated_at":"2015-02-27T07:49:10Z","due_on":null,"closed_at":null},"comments":13,"created_at":"2015-01-17T14:24:45Z","updated_at":"2015-02-28T10:10:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/twbs/bootstrap/pulls/15593","html_url":"https://github.com/twbs/bootstrap/pull/15593","diff_url":"https://github.com/twbs/bootstrap/pull/15593.diff","patch_url":"https://github.com/twbs/bootstrap/pull/15593.patch"},"body":"When the first two elements tracked by Scrollspy have an `offset.top` of 0, Scrollspy will flip between activating their respective nav events on every scroll event. This causes a visual 'flicker', and heavily degrades scroll performance.\r\n\r\nExamples:\r\n[Minimal example.](http://jsbin.com/lofaxoziha/5)\r\n[Example with nested sections.](http://jsbin.com/lofaxoziha/4)\r\n\r\nI saw this happen in a system of nested sections positioned hard against the top of the document, e.g.\r\n\r\n```\r\n<section id=\"animals\">\r\n  <section id=\"dogs\">\r\n\tContent\r\n  </section>\r\n</section>\r\n```\r\n\r\nThe bug is that Scrollspy's check to see if it's at the end of the array of sections uses `!arr[index + 1]`. This misses the case where `arr[index + 1]` does exist and is zero.\r\n\r\nThis commit explicitly checks the array bounds. A unit test is included, but I'm not familiar with bootstrap's testing approach so feedback is appreciated.\r\n\r\n(Thanks go to @theroux and @tnguyen14!)"},"comment":{"url":"https://api.github.com/repos/twbs/bootstrap/issues/comments/76520072","html_url":"https://github.com/twbs/bootstrap/pull/15593#issuecomment-76520072","issue_url":"https://api.github.com/repos/twbs/bootstrap/issues/15593","id":76520072,"user":{"login":"twbs-savage","id":8867116,"avatar_url":"https://avatars.githubusercontent.com/u/8867116?v=3","gravatar_id":"","url":"https://api.github.com/users/twbs-savage","html_url":"https://github.com/twbs-savage","followers_url":"https://api.github.com/users/twbs-savage/followers","following_url":"https://api.github.com/users/twbs-savage/following{/other_user}","gists_url":"https://api.github.com/users/twbs-savage/gists{/gist_id}","starred_url":"https://api.github.com/users/twbs-savage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twbs-savage/subscriptions","organizations_url":"https://api.github.com/users/twbs-savage/orgs","repos_url":"https://api.github.com/users/twbs-savage/repos","events_url":"https://api.github.com/users/twbs-savage/events{/privacy}","received_events_url":"https://api.github.com/users/twbs-savage/received_events","type":"User","site_admin":false},"created_at":"2015-02-28T10:10:03Z","updated_at":"2015-02-28T10:10:03Z","body":"\n**Tests passed.** Automated cross-browser testing via Sauce Labs and Travis CI shows that the JavaScript changes in this pull request are: **CONFIRMED**\n\nCommit: a9cbfc08c86341a732a758260927ec424e4af5ab\nBuild details: https://travis-ci.org/twbs-savage/bootstrap/builds/52524203\n\n(*Please note that this is a [fully automated](https://github.com/twbs/savage) comment.*)\n      "}}