{"action":"created","issue":{"url":"https://api.github.com/repos/whatwg/html/issues/2787","repository_url":"https://api.github.com/repos/whatwg/html","labels_url":"https://api.github.com/repos/whatwg/html/issues/2787/labels{/name}","comments_url":"https://api.github.com/repos/whatwg/html/issues/2787/comments","events_url":"https://api.github.com/repos/whatwg/html/issues/2787/events","html_url":"https://github.com/whatwg/html/pull/2787","id":238069672,"number":2787,"title":"Add scrollOptions for Element.focus()","user":{"login":"jihyerish","id":6636090,"avatar_url":"https://avatars1.githubusercontent.com/u/6636090?v=4","gravatar_id":"","url":"https://api.github.com/users/jihyerish","html_url":"https://github.com/jihyerish","followers_url":"https://api.github.com/users/jihyerish/followers","following_url":"https://api.github.com/users/jihyerish/following{/other_user}","gists_url":"https://api.github.com/users/jihyerish/gists{/gist_id}","starred_url":"https://api.github.com/users/jihyerish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jihyerish/subscriptions","organizations_url":"https://api.github.com/users/jihyerish/orgs","repos_url":"https://api.github.com/users/jihyerish/repos","events_url":"https://api.github.com/users/jihyerish/events{/privacy}","received_events_url":"https://api.github.com/users/jihyerish/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":78,"created_at":"2017-06-23T08:05:03Z","updated_at":"2017-10-19T06:53:21Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/whatwg/html/pulls/2787","html_url":"https://github.com/whatwg/html/pull/2787","diff_url":"https://github.com/whatwg/html/pull/2787.diff","patch_url":"https://github.com/whatwg/html/pull/2787.patch"},"body":"Add scrollOptions to Element.focus()\r\n\r\nThis option alllows the author to define the scroll behavior triggered when a focused element is partially viewed within the viewport.\r\n\r\n```\r\nscrollOptions\r\n{\r\n  behavior: \"auto\" | \"none\" | \"smooth\",\r\n  block: \"start\" | \"end\"\r\n }\r\n\r\n```\r\n\r\n- auto: A focused element scrolls into viewport instantly\r\n- none: A focused element doesn't scroll into viewport\r\n- smooth: A focused element scrolls into viewport smoothly\r\n\r\n- start: A focused element scrolls to the start (top) of the viewport.\r\n- end: A focused element scrolls to the end (bottom) of the viewport.\r\n\r\nscrollOptions refers to the scrollIntoViewOptions of Element.scrollIntoView().\r\n\r\nCloses https://github.com/whatwg/html/issues/834"},"comment":{"url":"https://api.github.com/repos/whatwg/html/issues/comments/337816108","html_url":"https://github.com/whatwg/html/pull/2787#issuecomment-337816108","issue_url":"https://api.github.com/repos/whatwg/html/issues/2787","id":337816108,"user":{"login":"anawhj","id":13619834,"avatar_url":"https://avatars0.githubusercontent.com/u/13619834?v=4","gravatar_id":"","url":"https://api.github.com/users/anawhj","html_url":"https://github.com/anawhj","followers_url":"https://api.github.com/users/anawhj/followers","following_url":"https://api.github.com/users/anawhj/following{/other_user}","gists_url":"https://api.github.com/users/anawhj/gists{/gist_id}","starred_url":"https://api.github.com/users/anawhj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anawhj/subscriptions","organizations_url":"https://api.github.com/users/anawhj/orgs","repos_url":"https://api.github.com/users/anawhj/repos","events_url":"https://api.github.com/users/anawhj/events{/privacy}","received_events_url":"https://api.github.com/users/anawhj/received_events","type":"User","site_admin":false},"created_at":"2017-10-19T06:53:21Z","updated_at":"2017-10-19T06:53:21Z","author_association":"NONE","body":"Per [w3c/csswg-drafts#1805 (comment)](https://github.com/w3c/csswg-drafts/pull/1805#issuecomment-337801758), it seems to be resolved as only applying `preventDefault` into focus() on CSSOM-View side. I think the following two options could  be considered:\r\n\r\n```javascript\r\n// option 1\r\ndictionary FocusOptions {\r\n  boolean preventScroll = false;\r\n};\r\nvoid focus(optional FocusOptions options);\r\n\r\n// option 2\r\nvoid focus(optional boolean preventScroll);\r\n```\r\n\r\nAs discussed above, I would prefer to have option 1 for the future extension, but I'm not sure it's right. If we decide one of the options and update the changes, I believe we could finalize this long journey since last June as a first phase for adding `scrollOptions` into focus()."}}
{"actor":{"display_login":"anawhj"}}