{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/draft-js/issues/453","repository_url":"https://api.github.com/repos/facebook/draft-js","labels_url":"https://api.github.com/repos/facebook/draft-js/issues/453/labels{/name}","comments_url":"https://api.github.com/repos/facebook/draft-js/issues/453/comments","events_url":"https://api.github.com/repos/facebook/draft-js/issues/453/events","html_url":"https://github.com/facebook/draft-js/pull/453","id":159311158,"number":453,"title":"Add support for preventing native character insertion","user":{"login":"paulyoung","id":84700,"avatar_url":"https://avatars.githubusercontent.com/u/84700?v=3","gravatar_id":"","url":"https://api.github.com/users/paulyoung","html_url":"https://github.com/paulyoung","followers_url":"https://api.github.com/users/paulyoung/followers","following_url":"https://api.github.com/users/paulyoung/following{/other_user}","gists_url":"https://api.github.com/users/paulyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/paulyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulyoung/subscriptions","organizations_url":"https://api.github.com/users/paulyoung/orgs","repos_url":"https://api.github.com/users/paulyoung/repos","events_url":"https://api.github.com/users/paulyoung/events{/privacy}","received_events_url":"https://api.github.com/users/paulyoung/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/facebook/draft-js/labels/CLA%20Signed","name":"CLA Signed","color":"009900"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2016-06-09T01:24:25Z","updated_at":"2016-06-27T17:30:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/facebook/draft-js/pulls/453","html_url":"https://github.com/facebook/draft-js/pull/453","diff_url":"https://github.com/facebook/draft-js/pull/453.diff","patch_url":"https://github.com/facebook/draft-js/pull/453.patch"},"body":"@hellendag this intends to address the issue we discussed in https://github.com/facebook/draft-js/issues/427 and https://github.com/facebook/draft-js/issues/448.\r\n\r\nThe intended use is something like this:\r\n\r\n```javascript\r\nonChange(editorState) {\r\n  const contentState = editorState.getCurrentContent();\r\n  const blockMap = contentState.getBlockMap();\r\n  const newBlockMap = blockMap.map((contentBlock) => {\r\n    // perform some updates here\r\n    return contentBlock;\r\n  });\r\n  const newContentState = contentState.set('blockMap', newBlockMap);\r\n  const newEditorState = EditorState.push(editorState, newContentState, 'insert-fragment');\r\n  this.setState({\r\n    editorState: EditorState.preventNativeInsertion(newEditorState, true),\r\n  });\r\n}\r\n```\r\n\r\nPlease review and let me know if you have any feedback.\r\n\r\nThanks!"},"comment":{"url":"https://api.github.com/repos/facebook/draft-js/issues/comments/228815764","html_url":"https://github.com/facebook/draft-js/pull/453#issuecomment-228815764","issue_url":"https://api.github.com/repos/facebook/draft-js/issues/453","id":228815764,"user":{"login":"paulyoung","id":84700,"avatar_url":"https://avatars.githubusercontent.com/u/84700?v=3","gravatar_id":"","url":"https://api.github.com/users/paulyoung","html_url":"https://github.com/paulyoung","followers_url":"https://api.github.com/users/paulyoung/followers","following_url":"https://api.github.com/users/paulyoung/following{/other_user}","gists_url":"https://api.github.com/users/paulyoung/gists{/gist_id}","starred_url":"https://api.github.com/users/paulyoung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/paulyoung/subscriptions","organizations_url":"https://api.github.com/users/paulyoung/orgs","repos_url":"https://api.github.com/users/paulyoung/repos","events_url":"https://api.github.com/users/paulyoung/events{/privacy}","received_events_url":"https://api.github.com/users/paulyoung/received_events","type":"User","site_admin":false},"created_at":"2016-06-27T17:30:32Z","updated_at":"2016-06-27T17:30:32Z","body":"I may have bandwidth to take a stab at fixing undo/redo with the latest changes soon.\r\n\r\nIf anyone has any ideas, I'd love to hear them!"}}
{"actor":{"display_login":"paulyoung"}}