{"action":"opened","number":15593,"pull_request":{"url":"https://api.github.com/repos/twbs/bootstrap/pulls/15593","id":27557318,"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","issue_url":"https://api.github.com/repos/twbs/bootstrap/issues/15593","number":15593,"state":"open","locked":false,"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},"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.\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!)","created_at":"2015-01-17T14:24:45Z","updated_at":"2015-01-17T14:24:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/twbs/bootstrap/pulls/15593/commits","review_comments_url":"https://api.github.com/repos/twbs/bootstrap/pulls/15593/comments","review_comment_url":"https://api.github.com/repos/twbs/bootstrap/pulls/comments/{number}","comments_url":"https://api.github.com/repos/twbs/bootstrap/issues/15593/comments","statuses_url":"https://api.github.com/repos/twbs/bootstrap/statuses/ad933c6780a4cf9139fc9ea39d9aab0897895243","head":{"label":"neoeno:handle_multiple_zero_offset_scrollspy_elements","ref":"handle_multiple_zero_offset_scrollspy_elements","sha":"ad933c6780a4cf9139fc9ea39d9aab0897895243","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},"repo":{"id":29373314,"name":"bootstrap","full_name":"neoeno/bootstrap","owner":{"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},"private":false,"html_url":"https://github.com/neoeno/bootstrap","description":"The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.","fork":true,"url":"https://api.github.com/repos/neoeno/bootstrap","forks_url":"https://api.github.com/repos/neoeno/bootstrap/forks","keys_url":"https://api.github.com/repos/neoeno/bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/neoeno/bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/neoeno/bootstrap/teams","hooks_url":"https://api.github.com/repos/neoeno/bootstrap/hooks","issue_events_url":"https://api.github.com/repos/neoeno/bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/neoeno/bootstrap/events","assignees_url":"https://api.github.com/repos/neoeno/bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/neoeno/bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/neoeno/bootstrap/tags","blobs_url":"https://api.github.com/repos/neoeno/bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/neoeno/bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/neoeno/bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/neoeno/bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/neoeno/bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/neoeno/bootstrap/languages","stargazers_url":"https://api.github.com/repos/neoeno/bootstrap/stargazers","contributors_url":"https://api.github.com/repos/neoeno/bootstrap/contributors","subscribers_url":"https://api.github.com/repos/neoeno/bootstrap/subscribers","subscription_url":"https://api.github.com/repos/neoeno/bootstrap/subscription","commits_url":"https://api.github.com/repos/neoeno/bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/neoeno/bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/neoeno/bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/neoeno/bootstrap/issues/comments/{number}","contents_url":"https://api.github.com/repos/neoeno/bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/neoeno/bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/neoeno/bootstrap/merges","archive_url":"https://api.github.com/repos/neoeno/bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/neoeno/bootstrap/downloads","issues_url":"https://api.github.com/repos/neoeno/bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/neoeno/bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/neoeno/bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/neoeno/bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/neoeno/bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/neoeno/bootstrap/releases{/id}","created_at":"2015-01-16T23:54:20Z","updated_at":"2015-01-16T23:54:28Z","pushed_at":"2015-01-17T01:14:25Z","git_url":"git://github.com/neoeno/bootstrap.git","ssh_url":"git@github.com:neoeno/bootstrap.git","clone_url":"https://github.com/neoeno/bootstrap.git","svn_url":"https://github.com/neoeno/bootstrap","homepage":"http://getbootstrap.com","size":73925,"stargazers_count":0,"watchers_count":0,"language":"CSS","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"twbs:master","ref":"master","sha":"8a1efe91df296e62bc560e51b462e9d51d31a988","user":{"login":"twbs","id":2918581,"avatar_url":"https://avatars.githubusercontent.com/u/2918581?v=3","gravatar_id":"","url":"https://api.github.com/users/twbs","html_url":"https://github.com/twbs","followers_url":"https://api.github.com/users/twbs/followers","following_url":"https://api.github.com/users/twbs/following{/other_user}","gists_url":"https://api.github.com/users/twbs/gists{/gist_id}","starred_url":"https://api.github.com/users/twbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twbs/subscriptions","organizations_url":"https://api.github.com/users/twbs/orgs","repos_url":"https://api.github.com/users/twbs/repos","events_url":"https://api.github.com/users/twbs/events{/privacy}","received_events_url":"https://api.github.com/users/twbs/received_events","type":"Organization","site_admin":false},"repo":{"id":2126244,"name":"bootstrap","full_name":"twbs/bootstrap","owner":{"login":"twbs","id":2918581,"avatar_url":"https://avatars.githubusercontent.com/u/2918581?v=3","gravatar_id":"","url":"https://api.github.com/users/twbs","html_url":"https://github.com/twbs","followers_url":"https://api.github.com/users/twbs/followers","following_url":"https://api.github.com/users/twbs/following{/other_user}","gists_url":"https://api.github.com/users/twbs/gists{/gist_id}","starred_url":"https://api.github.com/users/twbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twbs/subscriptions","organizations_url":"https://api.github.com/users/twbs/orgs","repos_url":"https://api.github.com/users/twbs/repos","events_url":"https://api.github.com/users/twbs/events{/privacy}","received_events_url":"https://api.github.com/users/twbs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/twbs/bootstrap","description":"The most popular HTML, CSS, and JavaScript framework for developing responsive, mobile first projects on the web.","fork":false,"url":"https://api.github.com/repos/twbs/bootstrap","forks_url":"https://api.github.com/repos/twbs/bootstrap/forks","keys_url":"https://api.github.com/repos/twbs/bootstrap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/twbs/bootstrap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/twbs/bootstrap/teams","hooks_url":"https://api.github.com/repos/twbs/bootstrap/hooks","issue_events_url":"https://api.github.com/repos/twbs/bootstrap/issues/events{/number}","events_url":"https://api.github.com/repos/twbs/bootstrap/events","assignees_url":"https://api.github.com/repos/twbs/bootstrap/assignees{/user}","branches_url":"https://api.github.com/repos/twbs/bootstrap/branches{/branch}","tags_url":"https://api.github.com/repos/twbs/bootstrap/tags","blobs_url":"https://api.github.com/repos/twbs/bootstrap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/twbs/bootstrap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/twbs/bootstrap/git/refs{/sha}","trees_url":"https://api.github.com/repos/twbs/bootstrap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/twbs/bootstrap/statuses/{sha}","languages_url":"https://api.github.com/repos/twbs/bootstrap/languages","stargazers_url":"https://api.github.com/repos/twbs/bootstrap/stargazers","contributors_url":"https://api.github.com/repos/twbs/bootstrap/contributors","subscribers_url":"https://api.github.com/repos/twbs/bootstrap/subscribers","subscription_url":"https://api.github.com/repos/twbs/bootstrap/subscription","commits_url":"https://api.github.com/repos/twbs/bootstrap/commits{/sha}","git_commits_url":"https://api.github.com/repos/twbs/bootstrap/git/commits{/sha}","comments_url":"https://api.github.com/repos/twbs/bootstrap/comments{/number}","issue_comment_url":"https://api.github.com/repos/twbs/bootstrap/issues/comments/{number}","contents_url":"https://api.github.com/repos/twbs/bootstrap/contents/{+path}","compare_url":"https://api.github.com/repos/twbs/bootstrap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/twbs/bootstrap/merges","archive_url":"https://api.github.com/repos/twbs/bootstrap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/twbs/bootstrap/downloads","issues_url":"https://api.github.com/repos/twbs/bootstrap/issues{/number}","pulls_url":"https://api.github.com/repos/twbs/bootstrap/pulls{/number}","milestones_url":"https://api.github.com/repos/twbs/bootstrap/milestones{/number}","notifications_url":"https://api.github.com/repos/twbs/bootstrap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/twbs/bootstrap/labels{/name}","releases_url":"https://api.github.com/repos/twbs/bootstrap/releases{/id}","created_at":"2011-07-29T21:19:00Z","updated_at":"2015-01-17T14:15:31Z","pushed_at":"2015-01-16T23:16:52Z","git_url":"git://github.com/twbs/bootstrap.git","ssh_url":"git@github.com:twbs/bootstrap.git","clone_url":"https://github.com/twbs/bootstrap.git","svn_url":"https://github.com/twbs/bootstrap","homepage":"http://getbootstrap.com","size":154610,"stargazers_count":76665,"watchers_count":76665,"language":"CSS","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":29312,"mirror_url":null,"open_issues_count":132,"forks":29312,"open_issues":132,"watchers":76665,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/twbs/bootstrap/pulls/15593"},"html":{"href":"https://github.com/twbs/bootstrap/pull/15593"},"issue":{"href":"https://api.github.com/repos/twbs/bootstrap/issues/15593"},"comments":{"href":"https://api.github.com/repos/twbs/bootstrap/issues/15593/comments"},"review_comments":{"href":"https://api.github.com/repos/twbs/bootstrap/pulls/15593/comments"},"review_comment":{"href":"https://api.github.com/repos/twbs/bootstrap/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/twbs/bootstrap/pulls/15593/commits"},"statuses":{"href":"https://api.github.com/repos/twbs/bootstrap/statuses/ad933c6780a4cf9139fc9ea39d9aab0897895243"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":43,"deletions":1,"changed_files":2}}