{"action":"created","comment":{"url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/comments/77730186","id":77730186,"diff_hunk":"@@ -90,16 +90,25 @@\n     },\n \n     /**\n-     * Resets all tabindex attributes to the appropriate value based on the\n+     * Reset attributes of the menu's new/changed collection of items:\n+     *\n+     * Reset all tabindex attributes to the appropriate value based on the\n      * current selection state. The appropriate value is `0` (focusable) for\n      * the default selected item, and `-1` (not keyboard focusable) for all\n      * other items.\n+     *\n+     * Reset the aria-selected attribute based on the current selection state.\n+     * As _applySelection notes, we need to set aria-selected to false for\n+     * unselected items, even in their initial state, not just when they become\n+     * deselected.\n      */\n-    _resetTabindices: function() {\n+    _resetItemAttributes: function() {\n       var selectedItem = this.multi ? (this.selectedItems && this.selectedItems[0]) : this.selectedItem;\n \n       this.items.forEach(function(item) {\n-        item.setAttribute('tabindex', item === selectedItem ? '0' : '-1');\n+        var isSelected = item === selectedItem;\n+        item.setAttribute('tabindex', isSelected ? '0' : '-1');\n+        item.setAttribute('aria-selected', isSelected);","path":"iron-menu-behavior.html","position":34,"original_position":34,"commit_id":"75bbb94e1659885936ac730de497b734d20f7e4b","original_commit_id":"12b17ac471afac5b28f97304a535aa593848f7c4","user":{"login":"JanMiksovsky","id":86139,"avatar_url":"https://avatars.githubusercontent.com/u/86139?v=3","gravatar_id":"","url":"https://api.github.com/users/JanMiksovsky","html_url":"https://github.com/JanMiksovsky","followers_url":"https://api.github.com/users/JanMiksovsky/followers","following_url":"https://api.github.com/users/JanMiksovsky/following{/other_user}","gists_url":"https://api.github.com/users/JanMiksovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/JanMiksovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanMiksovsky/subscriptions","organizations_url":"https://api.github.com/users/JanMiksovsky/orgs","repos_url":"https://api.github.com/users/JanMiksovsky/repos","events_url":"https://api.github.com/users/JanMiksovsky/events{/privacy}","received_events_url":"https://api.github.com/users/JanMiksovsky/received_events","type":"User","site_admin":false},"body":"Tab sets usually only have a small number of tabs. In the typical case of 3–7 tabs per tab set, I wouldn't expect an additional `setAttribute` per tab to have a noticeable impact on perf. Some tab-heavy designs (multiple tabbed regions on a single page, or tabs with tabs) might have more tabs — tens of tabs per page, maybe — but I'd still imagine that other costs would dominate.\r\n\r\nIt's possible that some attribute setting could be done lazily. E.g., with both attributes here, it **might** be possible to only set those attributes for the element with the focus and the elements on either side of it. But I'd imagine that could easily miss cases, and it seems safer to set the attributes when attached.","created_at":"2016-09-06T22:25:07Z","updated_at":"2016-09-06T22:25:07Z","html_url":"https://github.com/PolymerElements/iron-menu-behavior/pull/76#discussion_r77730186","pull_request_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/76","_links":{"self":{"href":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/comments/77730186"},"html":{"href":"https://github.com/PolymerElements/iron-menu-behavior/pull/76#discussion_r77730186"},"pull_request":{"href":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/76","id":82766996,"html_url":"https://github.com/PolymerElements/iron-menu-behavior/pull/76","diff_url":"https://github.com/PolymerElements/iron-menu-behavior/pull/76.diff","patch_url":"https://github.com/PolymerElements/iron-menu-behavior/pull/76.patch","issue_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/issues/76","number":76,"state":"open","locked":false,"title":"Set aria-selected=\"false\" on deselected items","user":{"login":"JanMiksovsky","id":86139,"avatar_url":"https://avatars.githubusercontent.com/u/86139?v=3","gravatar_id":"","url":"https://api.github.com/users/JanMiksovsky","html_url":"https://github.com/JanMiksovsky","followers_url":"https://api.github.com/users/JanMiksovsky/followers","following_url":"https://api.github.com/users/JanMiksovsky/following{/other_user}","gists_url":"https://api.github.com/users/JanMiksovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/JanMiksovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanMiksovsky/subscriptions","organizations_url":"https://api.github.com/users/JanMiksovsky/orgs","repos_url":"https://api.github.com/users/JanMiksovsky/repos","events_url":"https://api.github.com/users/JanMiksovsky/events{/privacy}","received_events_url":"https://api.github.com/users/JanMiksovsky/received_events","type":"User","site_admin":false},"body":"As @giltza noted in the original issue on paper-tabs, the `aria-selected` attribute should be set to \"false\" for deselected items, not removed.\r\n\r\nThis PR handles two situations: 1) ensures that all items start out with `aria-selected=\"false\"` by default, 2) sets `aria-selected=\"false\"` when a individual item is explicitly deselected.\r\n\r\nI've tested this fix under the indicated Windows screen reader, NVDA, and confirmed that paper-tabs now works as expected:\r\n* When using the arrow keys to navigate horizontally among paper-tabs, the name of each tab is announced.\r\n* The screen reader will only announce that the tab is selected if the tab is actually selected. (Previously, the screen reader would announce that the tab was selected, even if it was not, because unselected tabs were missing the `aria-selected` attribute.)","created_at":"2016-08-25T18:11:51Z","updated_at":"2016-09-06T22:25:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3ce8eb58100f8f1dbe38e500db0c23ee3de5b955","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/76/commits","review_comments_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/76/comments","review_comment_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/comments{/number}","comments_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/issues/76/comments","statuses_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/statuses/75bbb94e1659885936ac730de497b734d20f7e4b","head":{"label":"JanMiksovsky:issue-75","ref":"issue-75","sha":"75bbb94e1659885936ac730de497b734d20f7e4b","user":{"login":"JanMiksovsky","id":86139,"avatar_url":"https://avatars.githubusercontent.com/u/86139?v=3","gravatar_id":"","url":"https://api.github.com/users/JanMiksovsky","html_url":"https://github.com/JanMiksovsky","followers_url":"https://api.github.com/users/JanMiksovsky/followers","following_url":"https://api.github.com/users/JanMiksovsky/following{/other_user}","gists_url":"https://api.github.com/users/JanMiksovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/JanMiksovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanMiksovsky/subscriptions","organizations_url":"https://api.github.com/users/JanMiksovsky/orgs","repos_url":"https://api.github.com/users/JanMiksovsky/repos","events_url":"https://api.github.com/users/JanMiksovsky/events{/privacy}","received_events_url":"https://api.github.com/users/JanMiksovsky/received_events","type":"User","site_admin":false},"repo":{"id":66509903,"name":"iron-menu-behavior","full_name":"JanMiksovsky/iron-menu-behavior","owner":{"login":"JanMiksovsky","id":86139,"avatar_url":"https://avatars.githubusercontent.com/u/86139?v=3","gravatar_id":"","url":"https://api.github.com/users/JanMiksovsky","html_url":"https://github.com/JanMiksovsky","followers_url":"https://api.github.com/users/JanMiksovsky/followers","following_url":"https://api.github.com/users/JanMiksovsky/following{/other_user}","gists_url":"https://api.github.com/users/JanMiksovsky/gists{/gist_id}","starred_url":"https://api.github.com/users/JanMiksovsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JanMiksovsky/subscriptions","organizations_url":"https://api.github.com/users/JanMiksovsky/orgs","repos_url":"https://api.github.com/users/JanMiksovsky/repos","events_url":"https://api.github.com/users/JanMiksovsky/events{/privacy}","received_events_url":"https://api.github.com/users/JanMiksovsky/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/JanMiksovsky/iron-menu-behavior","description":"Accessible menu behavior","fork":true,"url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior","forks_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/forks","keys_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/teams","hooks_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/hooks","issue_events_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/issues/events{/number}","events_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/events","assignees_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/assignees{/user}","branches_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/branches{/branch}","tags_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/tags","blobs_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/git/refs{/sha}","trees_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/statuses/{sha}","languages_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/languages","stargazers_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/stargazers","contributors_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/contributors","subscribers_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/subscribers","subscription_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/subscription","commits_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/commits{/sha}","git_commits_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/git/commits{/sha}","comments_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/comments{/number}","issue_comment_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/issues/comments{/number}","contents_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/contents/{+path}","compare_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/merges","archive_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/downloads","issues_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/issues{/number}","pulls_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/pulls{/number}","milestones_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/milestones{/number}","notifications_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/labels{/name}","releases_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/releases{/id}","deployments_url":"https://api.github.com/repos/JanMiksovsky/iron-menu-behavior/deployments","created_at":"2016-08-25T00:34:48Z","updated_at":"2016-08-25T00:34:49Z","pushed_at":"2016-09-06T22:14:22Z","git_url":"git://github.com/JanMiksovsky/iron-menu-behavior.git","ssh_url":"git@github.com:JanMiksovsky/iron-menu-behavior.git","clone_url":"https://github.com/JanMiksovsky/iron-menu-behavior.git","svn_url":"https://github.com/JanMiksovsky/iron-menu-behavior","homepage":null,"size":95,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"PolymerElements:master","ref":"master","sha":"a0c185a39ef85f96a0316223db4d34f067fcb7f4","user":{"login":"PolymerElements","id":11639138,"avatar_url":"https://avatars.githubusercontent.com/u/11639138?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerElements","html_url":"https://github.com/PolymerElements","followers_url":"https://api.github.com/users/PolymerElements/followers","following_url":"https://api.github.com/users/PolymerElements/following{/other_user}","gists_url":"https://api.github.com/users/PolymerElements/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerElements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerElements/subscriptions","organizations_url":"https://api.github.com/users/PolymerElements/orgs","repos_url":"https://api.github.com/users/PolymerElements/repos","events_url":"https://api.github.com/users/PolymerElements/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerElements/received_events","type":"Organization","site_admin":false},"repo":{"id":34546968,"name":"iron-menu-behavior","full_name":"PolymerElements/iron-menu-behavior","owner":{"login":"PolymerElements","id":11639138,"avatar_url":"https://avatars.githubusercontent.com/u/11639138?v=3","gravatar_id":"","url":"https://api.github.com/users/PolymerElements","html_url":"https://github.com/PolymerElements","followers_url":"https://api.github.com/users/PolymerElements/followers","following_url":"https://api.github.com/users/PolymerElements/following{/other_user}","gists_url":"https://api.github.com/users/PolymerElements/gists{/gist_id}","starred_url":"https://api.github.com/users/PolymerElements/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PolymerElements/subscriptions","organizations_url":"https://api.github.com/users/PolymerElements/orgs","repos_url":"https://api.github.com/users/PolymerElements/repos","events_url":"https://api.github.com/users/PolymerElements/events{/privacy}","received_events_url":"https://api.github.com/users/PolymerElements/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/PolymerElements/iron-menu-behavior","description":"Accessible menu behavior","fork":false,"url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior","forks_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/forks","keys_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/keys{/key_id}","collaborators_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/teams","hooks_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/hooks","issue_events_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/issues/events{/number}","events_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/events","assignees_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/assignees{/user}","branches_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/branches{/branch}","tags_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/tags","blobs_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/git/refs{/sha}","trees_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/git/trees{/sha}","statuses_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/statuses/{sha}","languages_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/languages","stargazers_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/stargazers","contributors_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/contributors","subscribers_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/subscribers","subscription_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/subscription","commits_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/commits{/sha}","git_commits_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/git/commits{/sha}","comments_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/comments{/number}","issue_comment_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/issues/comments{/number}","contents_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/contents/{+path}","compare_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/compare/{base}...{head}","merges_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/merges","archive_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/downloads","issues_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/issues{/number}","pulls_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls{/number}","milestones_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/milestones{/number}","notifications_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/labels{/name}","releases_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/releases{/id}","deployments_url":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/deployments","created_at":"2015-04-24T23:31:47Z","updated_at":"2016-04-19T22:34:52Z","pushed_at":"2016-09-06T22:14:22Z","git_url":"git://github.com/PolymerElements/iron-menu-behavior.git","ssh_url":"git@github.com:PolymerElements/iron-menu-behavior.git","clone_url":"https://github.com/PolymerElements/iron-menu-behavior.git","svn_url":"https://github.com/PolymerElements/iron-menu-behavior","homepage":null,"size":110,"stargazers_count":4,"watchers_count":4,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":9,"forks":15,"open_issues":9,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/76"},"html":{"href":"https://github.com/PolymerElements/iron-menu-behavior/pull/76"},"issue":{"href":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/issues/76"},"comments":{"href":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/PolymerElements/iron-menu-behavior/statuses/75bbb94e1659885936ac730de497b734d20f7e4b"}}}}
{"actor":{"display_login":"JanMiksovsky"}}