{"action":"created","comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/227378504","pull_request_review_id":167403788,"id":227378504,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNzM3ODUwNA==","diff_hunk":"@@ -106,14 +107,18 @@ class CategoriesEdit extends Component {\n \t}\n \n \trenderCategoryDropdown() {\n-\t\tconst { showHierarchy } = this.props.attributes;\n+\t\tconst { showHierarchy, instanceId, className } = this.props;\n \t\tconst parentId = showHierarchy ? 0 : null;\n \t\tconst categories = this.getCategories( parentId );\n-\n \t\treturn (\n-\t\t\t<select className={ `${ this.props.className }__dropdown` }>\n-\t\t\t\t{ categories.map( ( category ) => this.renderCategoryDropdownItem( category, 0 ) ) }\n-\t\t\t</select>\n+\t\t\t<Fragment>\n+\t\t\t\t<label htmlFor={ `${ className }-${ instanceId }` } className=\"screen-reader-text\">\n+\t\t\t\t\t{ __( 'Categories' ) }\n+\t\t\t\t</label>\n+\t\t\t\t<select id={ `${ className }-${ instanceId }` } className={ `${ className }__dropdown` }>","path":"packages/block-library/src/categories/edit.js","position":32,"original_position":32,"commit_id":"664709562d7b8691f84680beff34bea711d477ac","original_commit_id":"664709562d7b8691f84680beff34bea711d477ac","user":{"login":"gziolo","id":699132,"node_id":"MDQ6VXNlcjY5OTEzMg==","avatar_url":"https://avatars2.githubusercontent.com/u/699132?v=4","gravatar_id":"","url":"https://api.github.com/users/gziolo","html_url":"https://github.com/gziolo","followers_url":"https://api.github.com/users/gziolo/followers","following_url":"https://api.github.com/users/gziolo/following{/other_user}","gists_url":"https://api.github.com/users/gziolo/gists{/gist_id}","starred_url":"https://api.github.com/users/gziolo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gziolo/subscriptions","organizations_url":"https://api.github.com/users/gziolo/orgs","repos_url":"https://api.github.com/users/gziolo/repos","events_url":"https://api.github.com/users/gziolo/events{/privacy}","received_events_url":"https://api.github.com/users/gziolo/received_events","type":"User","site_admin":false},"body":"I think `id` can be statically set in here to something like:\r\n```js\r\nconst selectId = 'block-library-category';\r\n...\r\n<label htmlFor={ `${ selectId }-${ instanceId }` } className=\"screen-reader-text\">\r\n....\r\n<select id={ `${ selectId }-${ instanceId }` } className={ `${ className }__dropdown` }>","created_at":"2018-10-23T13:02:27Z","updated_at":"2018-10-23T13:02:27Z","html_url":"https://github.com/WordPress/gutenberg/pull/10912#discussion_r227378504","pull_request_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/10912","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments/227378504"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/10912#discussion_r227378504"},"pull_request":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/10912"}}},"pull_request":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/10912","id":224769468,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI0NzY5NDY4","html_url":"https://github.com/WordPress/gutenberg/pull/10912","diff_url":"https://github.com/WordPress/gutenberg/pull/10912.diff","patch_url":"https://github.com/WordPress/gutenberg/pull/10912.patch","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/10912","number":10912,"state":"open","locked":false,"title":"Fix/categories block label missing","user":{"login":"LukePettway","id":3654512,"node_id":"MDQ6VXNlcjM2NTQ1MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/3654512?v=4","gravatar_id":"","url":"https://api.github.com/users/LukePettway","html_url":"https://github.com/LukePettway","followers_url":"https://api.github.com/users/LukePettway/followers","following_url":"https://api.github.com/users/LukePettway/following{/other_user}","gists_url":"https://api.github.com/users/LukePettway/gists{/gist_id}","starred_url":"https://api.github.com/users/LukePettway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukePettway/subscriptions","organizations_url":"https://api.github.com/users/LukePettway/orgs","repos_url":"https://api.github.com/users/LukePettway/repos","events_url":"https://api.github.com/users/LukePettway/events{/privacy}","received_events_url":"https://api.github.com/users/LukePettway/received_events","type":"User","site_admin":false},"body":"## Description\r\n\r\nThe categories block does not have a label when it is set to \"Display as dropdown\" as mentioned in #10871. This updates the markup in the admin to render a visually hidden label for assistive technology to provide context to the dropdown. \r\n\r\nAlso mentioned in the related issue above is that the labels should possibly be visual by default. Once merged, another PR can be opened to address that.\r\n\r\nOne thing to note is that various screen readers will respond differently to select dropdowns based on the type of label used (implicit vs explicit) so even though in my testing it never read the label because I was using VoiceOver and Safari, other browsers/screen readers will respond differently\r\n(http://www.davidmacd.com/blog/select-box-label.html)\r\n\r\n## How has this been tested?\r\nTested on OSX in Chrome, Safari, Firefox, Edge,  and IE11 using Browserstack. I used Voice Over + Safari to test that the label is properly read. \r\n\r\n## Screenshots <!-- if applicable -->\r\n![screen shot 2018-10-22 at 2 22 38 pm](https://user-images.githubusercontent.com/3654512/47310734-f8136000-d605-11e8-97eb-9cf890da0a25.png)\r\n\r\n<img width=\"300\" alt=\"screen shot 2018-10-22 at 2 24 40 pm\" src=\"https://user-images.githubusercontent.com/3654512/47310858-4294dc80-d606-11e8-83b8-b7de08f6ca68.png\">\r\n\r\n(My category name was test, which I now realize should probably be something a little more contextual)\r\n\r\n\r\n## Types of changes\r\nBug fix\r\n\r\n## Checklist:\r\n- [X] My code is tested.\r\n- [X] My code follows the WordPress code style. <!-- Check code: `npm run lint`, Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/ -->\r\n- [X] My code follows the accessibility standards. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/accessibility-coding-standards/ -->\r\n- [X] My code has proper inline documentation. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/ -->\r\n","created_at":"2018-10-22T18:26:36Z","updated_at":"2018-10-23T13:02:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8e54eee0c4d4255de7f7e2ac0550cdb0685f4ec3","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/10912/commits","review_comments_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/10912/comments","review_comment_url":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/10912/comments","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/664709562d7b8691f84680beff34bea711d477ac","head":{"label":"LukePettway:fix/categories-block-label-missing","ref":"fix/categories-block-label-missing","sha":"664709562d7b8691f84680beff34bea711d477ac","user":{"login":"LukePettway","id":3654512,"node_id":"MDQ6VXNlcjM2NTQ1MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/3654512?v=4","gravatar_id":"","url":"https://api.github.com/users/LukePettway","html_url":"https://github.com/LukePettway","followers_url":"https://api.github.com/users/LukePettway/followers","following_url":"https://api.github.com/users/LukePettway/following{/other_user}","gists_url":"https://api.github.com/users/LukePettway/gists{/gist_id}","starred_url":"https://api.github.com/users/LukePettway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukePettway/subscriptions","organizations_url":"https://api.github.com/users/LukePettway/orgs","repos_url":"https://api.github.com/users/LukePettway/repos","events_url":"https://api.github.com/users/LukePettway/events{/privacy}","received_events_url":"https://api.github.com/users/LukePettway/received_events","type":"User","site_admin":false},"repo":{"id":153638280,"node_id":"MDEwOlJlcG9zaXRvcnkxNTM2MzgyODA=","name":"gutenberg","full_name":"LukePettway/gutenberg","private":false,"owner":{"login":"LukePettway","id":3654512,"node_id":"MDQ6VXNlcjM2NTQ1MTI=","avatar_url":"https://avatars2.githubusercontent.com/u/3654512?v=4","gravatar_id":"","url":"https://api.github.com/users/LukePettway","html_url":"https://github.com/LukePettway","followers_url":"https://api.github.com/users/LukePettway/followers","following_url":"https://api.github.com/users/LukePettway/following{/other_user}","gists_url":"https://api.github.com/users/LukePettway/gists{/gist_id}","starred_url":"https://api.github.com/users/LukePettway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LukePettway/subscriptions","organizations_url":"https://api.github.com/users/LukePettway/orgs","repos_url":"https://api.github.com/users/LukePettway/repos","events_url":"https://api.github.com/users/LukePettway/events{/privacy}","received_events_url":"https://api.github.com/users/LukePettway/received_events","type":"User","site_admin":false},"html_url":"https://github.com/LukePettway/gutenberg","description":"Printing since 1440. Development hub for the editor focus in core. Plugin is available from the official WordPress repository.","fork":true,"url":"https://api.github.com/repos/LukePettway/gutenberg","forks_url":"https://api.github.com/repos/LukePettway/gutenberg/forks","keys_url":"https://api.github.com/repos/LukePettway/gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/LukePettway/gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/LukePettway/gutenberg/teams","hooks_url":"https://api.github.com/repos/LukePettway/gutenberg/hooks","issue_events_url":"https://api.github.com/repos/LukePettway/gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/LukePettway/gutenberg/events","assignees_url":"https://api.github.com/repos/LukePettway/gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/LukePettway/gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/LukePettway/gutenberg/tags","blobs_url":"https://api.github.com/repos/LukePettway/gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/LukePettway/gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/LukePettway/gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/LukePettway/gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/LukePettway/gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/LukePettway/gutenberg/languages","stargazers_url":"https://api.github.com/repos/LukePettway/gutenberg/stargazers","contributors_url":"https://api.github.com/repos/LukePettway/gutenberg/contributors","subscribers_url":"https://api.github.com/repos/LukePettway/gutenberg/subscribers","subscription_url":"https://api.github.com/repos/LukePettway/gutenberg/subscription","commits_url":"https://api.github.com/repos/LukePettway/gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/LukePettway/gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/LukePettway/gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/LukePettway/gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/LukePettway/gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/LukePettway/gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/LukePettway/gutenberg/merges","archive_url":"https://api.github.com/repos/LukePettway/gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/LukePettway/gutenberg/downloads","issues_url":"https://api.github.com/repos/LukePettway/gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/LukePettway/gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/LukePettway/gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/LukePettway/gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/LukePettway/gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/LukePettway/gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/LukePettway/gutenberg/deployments","created_at":"2018-10-18T14:32:17Z","updated_at":"2018-10-22T14:06:56Z","pushed_at":"2018-10-22T17:51:26Z","git_url":"git://github.com/LukePettway/gutenberg.git","ssh_url":"git@github.com:LukePettway/gutenberg.git","clone_url":"https://github.com/LukePettway/gutenberg.git","svn_url":"https://github.com/LukePettway/gutenberg","homepage":"https://wordpress.org/plugins/gutenberg/","size":28311,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"WordPress:master","ref":"master","sha":"1cd604df7e9017e0dbe3ab64897ac3af35ca35c5","user":{"login":"WordPress","id":276006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NjAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"repo":{"id":80862584,"node_id":"MDEwOlJlcG9zaXRvcnk4MDg2MjU4NA==","name":"gutenberg","full_name":"WordPress/gutenberg","private":false,"owner":{"login":"WordPress","id":276006,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI3NjAwNg==","avatar_url":"https://avatars0.githubusercontent.com/u/276006?v=4","gravatar_id":"","url":"https://api.github.com/users/WordPress","html_url":"https://github.com/WordPress","followers_url":"https://api.github.com/users/WordPress/followers","following_url":"https://api.github.com/users/WordPress/following{/other_user}","gists_url":"https://api.github.com/users/WordPress/gists{/gist_id}","starred_url":"https://api.github.com/users/WordPress/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WordPress/subscriptions","organizations_url":"https://api.github.com/users/WordPress/orgs","repos_url":"https://api.github.com/users/WordPress/repos","events_url":"https://api.github.com/users/WordPress/events{/privacy}","received_events_url":"https://api.github.com/users/WordPress/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/WordPress/gutenberg","description":"Printing since 1440. Development hub for the editor focus in core. Plugin is available from the official WordPress repository.","fork":false,"url":"https://api.github.com/repos/WordPress/gutenberg","forks_url":"https://api.github.com/repos/WordPress/gutenberg/forks","keys_url":"https://api.github.com/repos/WordPress/gutenberg/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WordPress/gutenberg/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WordPress/gutenberg/teams","hooks_url":"https://api.github.com/repos/WordPress/gutenberg/hooks","issue_events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/events{/number}","events_url":"https://api.github.com/repos/WordPress/gutenberg/events","assignees_url":"https://api.github.com/repos/WordPress/gutenberg/assignees{/user}","branches_url":"https://api.github.com/repos/WordPress/gutenberg/branches{/branch}","tags_url":"https://api.github.com/repos/WordPress/gutenberg/tags","blobs_url":"https://api.github.com/repos/WordPress/gutenberg/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WordPress/gutenberg/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WordPress/gutenberg/git/refs{/sha}","trees_url":"https://api.github.com/repos/WordPress/gutenberg/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WordPress/gutenberg/statuses/{sha}","languages_url":"https://api.github.com/repos/WordPress/gutenberg/languages","stargazers_url":"https://api.github.com/repos/WordPress/gutenberg/stargazers","contributors_url":"https://api.github.com/repos/WordPress/gutenberg/contributors","subscribers_url":"https://api.github.com/repos/WordPress/gutenberg/subscribers","subscription_url":"https://api.github.com/repos/WordPress/gutenberg/subscription","commits_url":"https://api.github.com/repos/WordPress/gutenberg/commits{/sha}","git_commits_url":"https://api.github.com/repos/WordPress/gutenberg/git/commits{/sha}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/comments{/number}","issue_comment_url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments{/number}","contents_url":"https://api.github.com/repos/WordPress/gutenberg/contents/{+path}","compare_url":"https://api.github.com/repos/WordPress/gutenberg/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WordPress/gutenberg/merges","archive_url":"https://api.github.com/repos/WordPress/gutenberg/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WordPress/gutenberg/downloads","issues_url":"https://api.github.com/repos/WordPress/gutenberg/issues{/number}","pulls_url":"https://api.github.com/repos/WordPress/gutenberg/pulls{/number}","milestones_url":"https://api.github.com/repos/WordPress/gutenberg/milestones{/number}","notifications_url":"https://api.github.com/repos/WordPress/gutenberg/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WordPress/gutenberg/labels{/name}","releases_url":"https://api.github.com/repos/WordPress/gutenberg/releases{/id}","deployments_url":"https://api.github.com/repos/WordPress/gutenberg/deployments","created_at":"2017-02-03T19:34:19Z","updated_at":"2018-10-23T12:51:51Z","pushed_at":"2018-10-23T12:51:21Z","git_url":"git://github.com/WordPress/gutenberg.git","ssh_url":"git@github.com:WordPress/gutenberg.git","clone_url":"https://github.com/WordPress/gutenberg.git","svn_url":"https://github.com/WordPress/gutenberg","homepage":"https://wordpress.org/plugins/gutenberg/","size":29149,"stargazers_count":3592,"watchers_count":3592,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":974,"mirror_url":null,"archived":false,"open_issues_count":1484,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":974,"open_issues":1484,"watchers":3592,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/10912"},"html":{"href":"https://github.com/WordPress/gutenberg/pull/10912"},"issue":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/10912"},"comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/issues/10912/comments"},"review_comments":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/10912/comments"},"review_comment":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WordPress/gutenberg/pulls/10912/commits"},"statuses":{"href":"https://api.github.com/repos/WordPress/gutenberg/statuses/664709562d7b8691f84680beff34bea711d477ac"}},"author_association":"NONE"}}
{"actor":{"display_login":"gziolo"}}