{"action":"created","issue":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/1886","repository_url":"https://api.github.com/repos/WordPress/gutenberg","labels_url":"https://api.github.com/repos/WordPress/gutenberg/issues/1886/labels{/name}","comments_url":"https://api.github.com/repos/WordPress/gutenberg/issues/1886/comments","events_url":"https://api.github.com/repos/WordPress/gutenberg/issues/1886/events","html_url":"https://github.com/WordPress/gutenberg/pull/1886","id":242767941,"number":1886,"title":"Post visibility panel better keyboard interaction.","user":{"login":"afercia","id":1682452,"avatar_url":"https://avatars1.githubusercontent.com/u/1682452?v=4","gravatar_id":"","url":"https://api.github.com/users/afercia","html_url":"https://github.com/afercia","followers_url":"https://api.github.com/users/afercia/followers","following_url":"https://api.github.com/users/afercia/following{/other_user}","gists_url":"https://api.github.com/users/afercia/gists{/gist_id}","starred_url":"https://api.github.com/users/afercia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afercia/subscriptions","organizations_url":"https://api.github.com/users/afercia/orgs","repos_url":"https://api.github.com/users/afercia/repos","events_url":"https://api.github.com/users/afercia/events{/privacy}","received_events_url":"https://api.github.com/users/afercia/received_events","type":"User","site_admin":false},"labels":[{"id":546517042,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/Accessibility","name":"Accessibility","color":"655104","default":false},{"id":596964332,"url":"https://api.github.com/repos/WordPress/gutenberg/labels/Chrome","name":"Chrome","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2017-07-13T17:01:19Z","updated_at":"2017-08-29T14:30:34Z","closed_at":"2017-08-29T14:30:34Z","pull_request":{"url":"https://api.github.com/repos/WordPress/gutenberg/pulls/1886","html_url":"https://github.com/WordPress/gutenberg/pull/1886","diff_url":"https://github.com/WordPress/gutenberg/pull/1886.diff","patch_url":"https://github.com/WordPress/gutenberg/pull/1886.patch"},"body":"This PR is a POC to try to address keyboard interaction on the Post Visibility panel:\r\n\r\nTo my understanding, `PostVisibility` is mounted when the sidebar opens so I'm not sure `withFocusReturn` can be used here. If only something similar to `react-click-outside` existed also for `focusOut`, things would be simpler. Any feedback for a better approach very welcome.\r\n\r\n- adds a keydown event to close the panel when pressing Escape\r\n- adds an blur event to close the panel when tabbing away (uses `event.relatedTarget`)\r\n- moves focus back to the toggle when closing the panel\r\n\r\nThe code here is mainly to share and discuss better approaches. I haven't found better ways to do this, so any help would be greatly appreciated 🙂 \r\n\r\nAlso to note: seems it doesn't work very well when using Safari+VoiceOver, while it works nicely with Firefox+NVDA.\r\n\r\nI also get a warning `A component is changing an uncontrolled input of type text to be controlled...` but this seems to happen also on master.\r\n\r\nFixes #1885 "},"comment":{"url":"https://api.github.com/repos/WordPress/gutenberg/issues/comments/325682478","html_url":"https://github.com/WordPress/gutenberg/pull/1886#issuecomment-325682478","issue_url":"https://api.github.com/repos/WordPress/gutenberg/issues/1886","id":325682478,"user":{"login":"afercia","id":1682452,"avatar_url":"https://avatars1.githubusercontent.com/u/1682452?v=4","gravatar_id":"","url":"https://api.github.com/users/afercia","html_url":"https://github.com/afercia","followers_url":"https://api.github.com/users/afercia/followers","following_url":"https://api.github.com/users/afercia/following{/other_user}","gists_url":"https://api.github.com/users/afercia/gists{/gist_id}","starred_url":"https://api.github.com/users/afercia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/afercia/subscriptions","organizations_url":"https://api.github.com/users/afercia/orgs","repos_url":"https://api.github.com/users/afercia/repos","events_url":"https://api.github.com/users/afercia/events{/privacy}","received_events_url":"https://api.github.com/users/afercia/received_events","type":"User","site_admin":false},"created_at":"2017-08-29T14:30:34Z","updated_at":"2017-08-29T14:30:34Z","body":"Closing as the PopOver component has seen big changes and the pending issues should be addressed with a new approach, see #2306 "}}
{"actor":{"display_login":"afercia"}}