{"action":"created","issue":{"url":"https://api.github.com/repos/angular/material/issues/6707","repository_url":"https://api.github.com/repos/angular/material","labels_url":"https://api.github.com/repos/angular/material/issues/6707/labels{/name}","comments_url":"https://api.github.com/repos/angular/material/issues/6707/comments","events_url":"https://api.github.com/repos/angular/material/issues/6707/events","html_url":"https://github.com/angular/material/pull/6707","id":126974144,"number":6707,"title":"fix(autocomplete) improved ESCAPE key interaction","user":{"login":"clshortfuse","id":9271155,"avatar_url":"https://avatars.githubusercontent.com/u/9271155?v=3","gravatar_id":"","url":"https://api.github.com/users/clshortfuse","html_url":"https://github.com/clshortfuse","followers_url":"https://api.github.com/users/clshortfuse/followers","following_url":"https://api.github.com/users/clshortfuse/following{/other_user}","gists_url":"https://api.github.com/users/clshortfuse/gists{/gist_id}","starred_url":"https://api.github.com/users/clshortfuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clshortfuse/subscriptions","organizations_url":"https://api.github.com/users/clshortfuse/orgs","repos_url":"https://api.github.com/users/clshortfuse/repos","events_url":"https://api.github.com/users/clshortfuse/events{/privacy}","received_events_url":"https://api.github.com/users/clshortfuse/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-01-15T22:47:34Z","updated_at":"2016-03-31T19:52:27Z","closed_at":"2016-03-31T19:52:27Z","pull_request":{"url":"https://api.github.com/repos/angular/material/pulls/6707","html_url":"https://github.com/angular/material/pull/6707","diff_url":"https://github.com/angular/material/pull/6707.diff","patch_url":"https://github.com/angular/material/pull/6707.patch"},"body":"If you press ESCAPE inside an autocomplete control, the input will always be captured, always clear the selection, and always blur.\r\n\r\nThe first change\r\n\r\n        if (ctrl.hidden && !ctrl.loading) //fixes escape event not being sent up\r\n            return;\r\n\r\n only responds when the autocomplete dropdown is hidden and not loading, which means the key event is sent upwards. This allows you to close dialogs when focused on an autocomplete control.\r\n\r\nThe removal of\r\n\r\n        clearValue();\r\n\r\n        // Force the component to blur if they hit escape\r\n        doBlur(true);\r\n\r\nand replaced with \r\n\r\n        ctrl.matches = [];\r\n        ctrl.hidden  = true;\r\n        ctrl.index   = getDefaultIndex();\r\n\r\nis the EXACT same Google Chrome Autocomplete interaction. Escape will close the dropdown while the dropdown stays in focus. ESCAPE never clears the value of the window in Google Chrome. If the user wants to go one step further to provide this interaction (clear and blur focus), this is actually now supported because the ESCAPE key event is passed up.\r\n\r\nThis would keep user input consistent with the commonly used browser (Google Chrome). I'm not sure how Safari, Firefox, Edge, etc work, but I would assume they work the same."},"comment":{"url":"https://api.github.com/repos/angular/material/issues/comments/204099756","html_url":"https://github.com/angular/material/pull/6707#issuecomment-204099756","issue_url":"https://api.github.com/repos/angular/material/issues/6707","id":204099756,"user":{"login":"clshortfuse","id":9271155,"avatar_url":"https://avatars.githubusercontent.com/u/9271155?v=3","gravatar_id":"","url":"https://api.github.com/users/clshortfuse","html_url":"https://github.com/clshortfuse","followers_url":"https://api.github.com/users/clshortfuse/followers","following_url":"https://api.github.com/users/clshortfuse/following{/other_user}","gists_url":"https://api.github.com/users/clshortfuse/gists{/gist_id}","starred_url":"https://api.github.com/users/clshortfuse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clshortfuse/subscriptions","organizations_url":"https://api.github.com/users/clshortfuse/orgs","repos_url":"https://api.github.com/users/clshortfuse/repos","events_url":"https://api.github.com/users/clshortfuse/events{/privacy}","received_events_url":"https://api.github.com/users/clshortfuse/received_events","type":"User","site_admin":false},"created_at":"2016-03-31T19:52:27Z","updated_at":"2016-03-31T19:52:27Z","body":"closing for https://github.com/angular/material/pull/6707 which isn't a breaking change"}}