{"action":"created","issue":{"url":"https://api.github.com/repos/facebook/draft-js/issues/119","repository_url":"https://api.github.com/repos/facebook/draft-js","labels_url":"https://api.github.com/repos/facebook/draft-js/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/facebook/draft-js/issues/119/comments","events_url":"https://api.github.com/repos/facebook/draft-js/issues/119/events","html_url":"https://github.com/facebook/draft-js/issues/119","id":137146462,"number":119,"title":"how to limit the maximum input length?","user":{"login":"LiaoSept","id":15375011,"avatar_url":"https://avatars.githubusercontent.com/u/15375011?v=3","gravatar_id":"","url":"https://api.github.com/users/LiaoSept","html_url":"https://github.com/LiaoSept","followers_url":"https://api.github.com/users/LiaoSept/followers","following_url":"https://api.github.com/users/LiaoSept/following{/other_user}","gists_url":"https://api.github.com/users/LiaoSept/gists{/gist_id}","starred_url":"https://api.github.com/users/LiaoSept/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiaoSept/subscriptions","organizations_url":"https://api.github.com/users/LiaoSept/orgs","repos_url":"https://api.github.com/users/LiaoSept/repos","events_url":"https://api.github.com/users/LiaoSept/events{/privacy}","received_events_url":"https://api.github.com/users/LiaoSept/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-02-29T04:21:48Z","updated_at":"2016-02-29T08:47:34Z","closed_at":"2016-02-29T08:47:34Z","body":""},"comment":{"url":"https://api.github.com/repos/facebook/draft-js/issues/comments/190106617","html_url":"https://github.com/facebook/draft-js/issues/119#issuecomment-190106617","issue_url":"https://api.github.com/repos/facebook/draft-js/issues/119","id":190106617,"user":{"login":"LiaoSept","id":15375011,"avatar_url":"https://avatars.githubusercontent.com/u/15375011?v=3","gravatar_id":"","url":"https://api.github.com/users/LiaoSept","html_url":"https://github.com/LiaoSept","followers_url":"https://api.github.com/users/LiaoSept/followers","following_url":"https://api.github.com/users/LiaoSept/following{/other_user}","gists_url":"https://api.github.com/users/LiaoSept/gists{/gist_id}","starred_url":"https://api.github.com/users/LiaoSept/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LiaoSept/subscriptions","organizations_url":"https://api.github.com/users/LiaoSept/orgs","repos_url":"https://api.github.com/users/LiaoSept/repos","events_url":"https://api.github.com/users/LiaoSept/events{/privacy}","received_events_url":"https://api.github.com/users/LiaoSept/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T08:47:34Z","updated_at":"2016-02-29T08:47:34Z","body":"to solve the problem, as follows:\r\n```javascript\r\nonChange(editorState) {\r\n    const contentState = editorState.getCurrentContent();\r\n    if (contentState.getPlainText().length > this.props.maxLength) {\r\n        editorState = EditorState.undo(editorState);\r\n    }\r\n    this.setState({editorState});\r\n}\r\n```"}}