{"action":"closed","issue":{"url":"https://api.github.com/repos/erikras/redux-form/issues/3253","repository_url":"https://api.github.com/repos/erikras/redux-form","labels_url":"https://api.github.com/repos/erikras/redux-form/issues/3253/labels{/name}","comments_url":"https://api.github.com/repos/erikras/redux-form/issues/3253/comments","events_url":"https://api.github.com/repos/erikras/redux-form/issues/3253/events","html_url":"https://github.com/erikras/redux-form/issues/3253","id":245962310,"number":3253,"title":"Input cursor/caret jumps to the end when component is stateful","user":{"login":"weaintplastic","id":1778130,"avatar_url":"https://avatars0.githubusercontent.com/u/1778130?v=4","gravatar_id":"","url":"https://api.github.com/users/weaintplastic","html_url":"https://github.com/weaintplastic","followers_url":"https://api.github.com/users/weaintplastic/followers","following_url":"https://api.github.com/users/weaintplastic/following{/other_user}","gists_url":"https://api.github.com/users/weaintplastic/gists{/gist_id}","starred_url":"https://api.github.com/users/weaintplastic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weaintplastic/subscriptions","organizations_url":"https://api.github.com/users/weaintplastic/orgs","repos_url":"https://api.github.com/users/weaintplastic/repos","events_url":"https://api.github.com/users/weaintplastic/events{/privacy}","received_events_url":"https://api.github.com/users/weaintplastic/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-07-27T08:22:26Z","updated_at":"2017-07-27T20:55:16Z","closed_at":"2017-07-27T20:55:16Z","body":"### Are you submitting a **bug report** or a **feature request**?\r\nBug\r\n\r\n### What is the current behavior?\r\nThere are some reports out there that dealing with the issue that the cursor/caret is jumping to the end of an input whenever text is entered somewhere in the middle or beginning.\r\n\r\nI've set up a minimal use-case that demonstrates that behavior in relation to wether or not the custom component is handling an internal state. In this case the component keeps information in a state of the total characters left to type in order to display them next to the input component.\r\n\r\nhttps://codesandbox.io/s/KGXD07rz\r\n\r\n![](http://i.imgur.com/7nvvbrf.gif)\r\n\r\nBy commenting out line 21 in `components/Input.js` you can switch between a working and not working setup:\r\n\r\n```\r\n    this.setState({\r\n      charsLeft: maxLength - event.target.value.length,\r\n    });\r\n```\r\n\r\n### What is the expected behavior?\r\nThe expected bahavior is to persist the cursor position while typing. \r\n\r\n\r\n### Sandbox Link\r\nhttps://codesandbox.io/s/KGXD07rz\r\n\r\n\r\n### What's your environment?\r\nredux-form 7.0.1\r\nredux 3.6.0\r\nreact-redux 5.0.4\r\nreact 15.5.3\r\nreact-dom 15.5.3\r\n\r\nBrowser: Chrome (latest)\r\nOS: Mac Os\r\n\r\n### Other information\r\nRelated issue: https://github.com/erikras/redux-form/issues/2049\r\n"}}
{"actor":{"display_login":"gustavohenke"}}