{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/roosterjs/pulls/comments/244520406","pull_request_review_id":188425034,"id":244520406,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NDUyMDQwNg==","diff_hunk":"@@ -210,22 +217,38 @@ export default class CorePlugin implements EditorPlugin {\n         }\r\n     }\r\n \r\n+    private onKeyPress(event: PluginKeyboardEvent) {\r\n+        // If normalization was not possible before the keypress,\r\n+        // check again after the keyboard event has been processed by browser native behaviour.\r\n+        //\r\n+        // This handles the case where the keyboard event that first inserts content happens when\r\n+        // there is already content under the selection (e.g. Ctrl+a -> type new content).\r\n+        if (!this.tryNormalizeTyping(event)) {\r\n+            requestAnimationFrame(() => {\r","path":"packages/roosterjs-editor-core/lib/editor/CorePlugin.ts","position":75,"original_position":75,"commit_id":"73fe94239d0465499e50adf5e2fdcb55f63e04cd","original_commit_id":"73fe94239d0465499e50adf5e2fdcb55f63e04cd","user":{"login":"JiuqingSong","id":23065085,"node_id":"MDQ6VXNlcjIzMDY1MDg1","avatar_url":"https://avatars1.githubusercontent.com/u/23065085?v=4","gravatar_id":"","url":"https://api.github.com/users/JiuqingSong","html_url":"https://github.com/JiuqingSong","followers_url":"https://api.github.com/users/JiuqingSong/followers","following_url":"https://api.github.com/users/JiuqingSong/following{/other_user}","gists_url":"https://api.github.com/users/JiuqingSong/gists{/gist_id}","starred_url":"https://api.github.com/users/JiuqingSong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JiuqingSong/subscriptions","organizations_url":"https://api.github.com/users/JiuqingSong/orgs","repos_url":"https://api.github.com/users/JiuqingSong/repos","events_url":"https://api.github.com/users/JiuqingSong/events{/privacy}","received_events_url":"https://api.github.com/users/JiuqingSong/received_events","type":"User","site_admin":false},"body":"You can check range.collapsed, and only do this when it is false.","created_at":"2018-12-29T23:54:08Z","updated_at":"2018-12-29T23:54:08Z","html_url":"https://github.com/Microsoft/roosterjs/pull/188#discussion_r244520406","pull_request_url":"https://api.github.com/repos/Microsoft/roosterjs/pulls/188","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/roosterjs/pulls/comments/244520406"},"html":{"href":"https://github.com/Microsoft/roosterjs/pull/188#discussion_r244520406"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/roosterjs/pulls/188"}},"in_reply_to_id":244520321},"pull_request":{"url":"https://api.github.com/repos/Microsoft/roosterjs/pulls/188","id":241242305,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQxMjQyMzA1","html_url":"https://github.com/Microsoft/roosterjs/pull/188","diff_url":"https://github.com/Microsoft/roosterjs/pull/188.diff","patch_url":"https://github.com/Microsoft/roosterjs/pull/188.patch","issue_url":"https://api.github.com/repos/Microsoft/roosterjs/issues/188","number":188,"state":"open","locked":false,"title":"fix ctrl+a -> typing issue","user":{"login":"Adjective-Object","id":1174858,"node_id":"MDQ6VXNlcjExNzQ4NTg=","avatar_url":"https://avatars3.githubusercontent.com/u/1174858?v=4","gravatar_id":"","url":"https://api.github.com/users/Adjective-Object","html_url":"https://github.com/Adjective-Object","followers_url":"https://api.github.com/users/Adjective-Object/followers","following_url":"https://api.github.com/users/Adjective-Object/following{/other_user}","gists_url":"https://api.github.com/users/Adjective-Object/gists{/gist_id}","starred_url":"https://api.github.com/users/Adjective-Object/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Adjective-Object/subscriptions","organizations_url":"https://api.github.com/users/Adjective-Object/orgs","repos_url":"https://api.github.com/users/Adjective-Object/repos","events_url":"https://api.github.com/users/Adjective-Object/events{/privacy}","received_events_url":"https://api.github.com/users/Adjective-Object/received_events","type":"User","site_admin":false},"body":"Fixes an issue where typing normalization did not run on ctrl+a -> typing \r\n\r\nThe bug is because normalization runs before the keypress, and only on an empty div.\r\n\r\nso\r\n- have text content\r\n- ctrl+a to select all\r\n- press a button that would type text\r\n- text format normalization does not run because you have text\r\n- browser CED behaviour puts the text into a div at the root level of the document\r\n- text is not formatted.\r\n\r\nSee #189 for tests.","created_at":"2018-12-28T00:11:07Z","updated_at":"2018-12-29T23:54:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9392218515522f923786a95b8c800d20ca31e4f3","assignee":null,"assignees":[],"requested_reviewers":[{"login":"Lego6245","id":1329165,"node_id":"MDQ6VXNlcjEzMjkxNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/1329165?v=4","gravatar_id":"","url":"https://api.github.com/users/Lego6245","html_url":"https://github.com/Lego6245","followers_url":"https://api.github.com/users/Lego6245/followers","following_url":"https://api.github.com/users/Lego6245/following{/other_user}","gists_url":"https://api.github.com/users/Lego6245/gists{/gist_id}","starred_url":"https://api.github.com/users/Lego6245/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lego6245/subscriptions","organizations_url":"https://api.github.com/users/Lego6245/orgs","repos_url":"https://api.github.com/users/Lego6245/repos","events_url":"https://api.github.com/users/Lego6245/events{/privacy}","received_events_url":"https://api.github.com/users/Lego6245/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/roosterjs/pulls/188/commits","review_comments_url":"https://api.github.com/repos/Microsoft/roosterjs/pulls/188/comments","review_comment_url":"https://api.github.com/repos/Microsoft/roosterjs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/roosterjs/issues/188/comments","statuses_url":"https://api.github.com/repos/Microsoft/roosterjs/statuses/73fe94239d0465499e50adf5e2fdcb55f63e04cd","head":{"label":"Microsoft:mahuangh-fix-editor-typing","ref":"mahuangh-fix-editor-typing","sha":"73fe94239d0465499e50adf5e2fdcb55f63e04cd","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":97145011,"node_id":"MDEwOlJlcG9zaXRvcnk5NzE0NTAxMQ==","name":"roosterjs","full_name":"Microsoft/roosterjs","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/roosterjs","description":"roosterjs is a framework-independent javascript rich text editor.","fork":false,"url":"https://api.github.com/repos/Microsoft/roosterjs","forks_url":"https://api.github.com/repos/Microsoft/roosterjs/forks","keys_url":"https://api.github.com/repos/Microsoft/roosterjs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/roosterjs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/roosterjs/teams","hooks_url":"https://api.github.com/repos/Microsoft/roosterjs/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/roosterjs/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/roosterjs/events","assignees_url":"https://api.github.com/repos/Microsoft/roosterjs/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/roosterjs/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/roosterjs/tags","blobs_url":"https://api.github.com/repos/Microsoft/roosterjs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/roosterjs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/roosterjs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/roosterjs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/roosterjs/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/roosterjs/languages","stargazers_url":"https://api.github.com/repos/Microsoft/roosterjs/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/roosterjs/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/roosterjs/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/roosterjs/subscription","commits_url":"https://api.github.com/repos/Microsoft/roosterjs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/roosterjs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/roosterjs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/roosterjs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/roosterjs/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/roosterjs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/roosterjs/merges","archive_url":"https://api.github.com/repos/Microsoft/roosterjs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/roosterjs/downloads","issues_url":"https://api.github.com/repos/Microsoft/roosterjs/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/roosterjs/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/roosterjs/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/roosterjs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/roosterjs/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/roosterjs/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/roosterjs/deployments","created_at":"2017-07-13T16:39:51Z","updated_at":"2018-12-28T00:50:48Z","pushed_at":"2018-12-28T00:40:05Z","git_url":"git://github.com/Microsoft/roosterjs.git","ssh_url":"git@github.com:Microsoft/roosterjs.git","clone_url":"https://github.com/Microsoft/roosterjs.git","svn_url":"https://github.com/Microsoft/roosterjs","homepage":null,"size":3927,"stargazers_count":186,"watchers_count":186,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":21,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":21,"open_issues":15,"watchers":186,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"61172bec8923d1649805109a639a4bf83c95bee7","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":97145011,"node_id":"MDEwOlJlcG9zaXRvcnk5NzE0NTAxMQ==","name":"roosterjs","full_name":"Microsoft/roosterjs","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/roosterjs","description":"roosterjs is a framework-independent javascript rich text editor.","fork":false,"url":"https://api.github.com/repos/Microsoft/roosterjs","forks_url":"https://api.github.com/repos/Microsoft/roosterjs/forks","keys_url":"https://api.github.com/repos/Microsoft/roosterjs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/roosterjs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/roosterjs/teams","hooks_url":"https://api.github.com/repos/Microsoft/roosterjs/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/roosterjs/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/roosterjs/events","assignees_url":"https://api.github.com/repos/Microsoft/roosterjs/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/roosterjs/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/roosterjs/tags","blobs_url":"https://api.github.com/repos/Microsoft/roosterjs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/roosterjs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/roosterjs/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/roosterjs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/roosterjs/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/roosterjs/languages","stargazers_url":"https://api.github.com/repos/Microsoft/roosterjs/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/roosterjs/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/roosterjs/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/roosterjs/subscription","commits_url":"https://api.github.com/repos/Microsoft/roosterjs/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/roosterjs/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/roosterjs/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/roosterjs/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/roosterjs/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/roosterjs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/roosterjs/merges","archive_url":"https://api.github.com/repos/Microsoft/roosterjs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/roosterjs/downloads","issues_url":"https://api.github.com/repos/Microsoft/roosterjs/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/roosterjs/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/roosterjs/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/roosterjs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/roosterjs/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/roosterjs/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/roosterjs/deployments","created_at":"2017-07-13T16:39:51Z","updated_at":"2018-12-28T00:50:48Z","pushed_at":"2018-12-28T00:40:05Z","git_url":"git://github.com/Microsoft/roosterjs.git","ssh_url":"git@github.com:Microsoft/roosterjs.git","clone_url":"https://github.com/Microsoft/roosterjs.git","svn_url":"https://github.com/Microsoft/roosterjs","homepage":null,"size":3927,"stargazers_count":186,"watchers_count":186,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":21,"mirror_url":null,"archived":false,"open_issues_count":15,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":21,"open_issues":15,"watchers":186,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/roosterjs/pulls/188"},"html":{"href":"https://github.com/Microsoft/roosterjs/pull/188"},"issue":{"href":"https://api.github.com/repos/Microsoft/roosterjs/issues/188"},"comments":{"href":"https://api.github.com/repos/Microsoft/roosterjs/issues/188/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/roosterjs/pulls/188/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/roosterjs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/roosterjs/pulls/188/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/roosterjs/statuses/73fe94239d0465499e50adf5e2fdcb55f63e04cd"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"JiuqingSong"}}