{"action":"created","comment":{"url":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/comments/210904785","pull_request_review_id":147219931,"id":210904785,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMDkwNDc4NQ==","diff_hunk":"@@ -22,9 +22,18 @@ const CodeEditor = class extends Component {\n             // When the user presses tab we prevent the default propagation, so we need to udpate\n             // the state manually here\n             this.props.onChange(`${value.substring(0, selectionStart)}\\t${value.substring(selectionEnd)}`);\n+            this.updateCursorPosition(selectionStart + 1);\n         }\n     }\n \n+    updateCursorPosition(position) {\n+        const editor = this.editor.current;\n+        this.setState({}, () => {","path":"ui/components/common/CodeEditor.js","position":10,"original_position":10,"commit_id":"6e880a37aeb78a4e352839de97899c9d5ca9dea7","original_commit_id":"6e880a37aeb78a4e352839de97899c9d5ca9dea7","user":{"login":"josemigallas","id":11672286,"node_id":"MDQ6VXNlcjExNjcyMjg2","avatar_url":"https://avatars0.githubusercontent.com/u/11672286?v=4","gravatar_id":"","url":"https://api.github.com/users/josemigallas","html_url":"https://github.com/josemigallas","followers_url":"https://api.github.com/users/josemigallas/followers","following_url":"https://api.github.com/users/josemigallas/following{/other_user}","gists_url":"https://api.github.com/users/josemigallas/gists{/gist_id}","starred_url":"https://api.github.com/users/josemigallas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josemigallas/subscriptions","organizations_url":"https://api.github.com/users/josemigallas/orgs","repos_url":"https://api.github.com/users/josemigallas/repos","events_url":"https://api.github.com/users/josemigallas/events{/privacy}","received_events_url":"https://api.github.com/users/josemigallas/received_events","type":"User","site_admin":false},"body":"What's setState here for?","created_at":"2018-08-17T13:14:37Z","updated_at":"2018-08-17T13:14:37Z","html_url":"https://github.com/aerogear/data-sync-ui/pull/111#discussion_r210904785","pull_request_url":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/111","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/comments/210904785"},"html":{"href":"https://github.com/aerogear/data-sync-ui/pull/111#discussion_r210904785"},"pull_request":{"href":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/111"}}},"pull_request":{"url":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/111","id":209125260,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5MTI1MjYw","html_url":"https://github.com/aerogear/data-sync-ui/pull/111","diff_url":"https://github.com/aerogear/data-sync-ui/pull/111.diff","patch_url":"https://github.com/aerogear/data-sync-ui/pull/111.patch","issue_url":"https://api.github.com/repos/aerogear/data-sync-ui/issues/111","number":111,"state":"open","locked":false,"title":"Fixed cursor positioning after hitting tab button","user":{"login":"psturc","id":4881144,"node_id":"MDQ6VXNlcjQ4ODExNDQ=","avatar_url":"https://avatars1.githubusercontent.com/u/4881144?v=4","gravatar_id":"","url":"https://api.github.com/users/psturc","html_url":"https://github.com/psturc","followers_url":"https://api.github.com/users/psturc/followers","following_url":"https://api.github.com/users/psturc/following{/other_user}","gists_url":"https://api.github.com/users/psturc/gists{/gist_id}","starred_url":"https://api.github.com/users/psturc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psturc/subscriptions","organizations_url":"https://api.github.com/users/psturc/orgs","repos_url":"https://api.github.com/users/psturc/repos","events_url":"https://api.github.com/users/psturc/events{/privacy}","received_events_url":"https://api.github.com/users/psturc/received_events","type":"User","site_admin":false},"body":"## Motivation\r\nhttps://issues.jboss.org/browse/AEROGEAR-7789\r\n## What\r\nPreviously, in the schema editor, when you hit TAB button, new tab character was added as expected, but a cursor jumped to the last character of the whole schema\r\n## How\r\nBy passing a callback to `setState` function, which may not be the best approach.\r\nUnfortunately the only one that worked for me (feel free to suggest a better way)\r\n## Verification Steps\r\nGo to schema editor, type couple of lines of text, move cursor to the middle (between characters) and press tab. It should behave like you're used to in common text editor.","created_at":"2018-08-17T11:51:52Z","updated_at":"2018-08-17T13:14:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c348a5b9f30db9a3e8489d46b752fcc046561ca2","assignee":null,"assignees":[],"requested_reviewers":[{"login":"pb82","id":1851198,"node_id":"MDQ6VXNlcjE4NTExOTg=","avatar_url":"https://avatars3.githubusercontent.com/u/1851198?v=4","gravatar_id":"","url":"https://api.github.com/users/pb82","html_url":"https://github.com/pb82","followers_url":"https://api.github.com/users/pb82/followers","following_url":"https://api.github.com/users/pb82/following{/other_user}","gists_url":"https://api.github.com/users/pb82/gists{/gist_id}","starred_url":"https://api.github.com/users/pb82/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pb82/subscriptions","organizations_url":"https://api.github.com/users/pb82/orgs","repos_url":"https://api.github.com/users/pb82/repos","events_url":"https://api.github.com/users/pb82/events{/privacy}","received_events_url":"https://api.github.com/users/pb82/received_events","type":"User","site_admin":false},{"login":"cfoskin","id":7661017,"node_id":"MDQ6VXNlcjc2NjEwMTc=","avatar_url":"https://avatars2.githubusercontent.com/u/7661017?v=4","gravatar_id":"","url":"https://api.github.com/users/cfoskin","html_url":"https://github.com/cfoskin","followers_url":"https://api.github.com/users/cfoskin/followers","following_url":"https://api.github.com/users/cfoskin/following{/other_user}","gists_url":"https://api.github.com/users/cfoskin/gists{/gist_id}","starred_url":"https://api.github.com/users/cfoskin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cfoskin/subscriptions","organizations_url":"https://api.github.com/users/cfoskin/orgs","repos_url":"https://api.github.com/users/cfoskin/repos","events_url":"https://api.github.com/users/cfoskin/events{/privacy}","received_events_url":"https://api.github.com/users/cfoskin/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/111/commits","review_comments_url":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/111/comments","review_comment_url":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/aerogear/data-sync-ui/issues/111/comments","statuses_url":"https://api.github.com/repos/aerogear/data-sync-ui/statuses/6e880a37aeb78a4e352839de97899c9d5ca9dea7","head":{"label":"aerogear:AEROGEAR-7789","ref":"AEROGEAR-7789","sha":"6e880a37aeb78a4e352839de97899c9d5ca9dea7","user":{"login":"aerogear","id":954205,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk1NDIwNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/954205?v=4","gravatar_id":"","url":"https://api.github.com/users/aerogear","html_url":"https://github.com/aerogear","followers_url":"https://api.github.com/users/aerogear/followers","following_url":"https://api.github.com/users/aerogear/following{/other_user}","gists_url":"https://api.github.com/users/aerogear/gists{/gist_id}","starred_url":"https://api.github.com/users/aerogear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerogear/subscriptions","organizations_url":"https://api.github.com/users/aerogear/orgs","repos_url":"https://api.github.com/users/aerogear/repos","events_url":"https://api.github.com/users/aerogear/events{/privacy}","received_events_url":"https://api.github.com/users/aerogear/received_events","type":"Organization","site_admin":false},"repo":{"id":139133264,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkxMzMyNjQ=","name":"data-sync-ui","full_name":"aerogear/data-sync-ui","owner":{"login":"aerogear","id":954205,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk1NDIwNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/954205?v=4","gravatar_id":"","url":"https://api.github.com/users/aerogear","html_url":"https://github.com/aerogear","followers_url":"https://api.github.com/users/aerogear/followers","following_url":"https://api.github.com/users/aerogear/following{/other_user}","gists_url":"https://api.github.com/users/aerogear/gists{/gist_id}","starred_url":"https://api.github.com/users/aerogear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerogear/subscriptions","organizations_url":"https://api.github.com/users/aerogear/orgs","repos_url":"https://api.github.com/users/aerogear/repos","events_url":"https://api.github.com/users/aerogear/events{/privacy}","received_events_url":"https://api.github.com/users/aerogear/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aerogear/data-sync-ui","description":"UI for the AeroGear Data Sync server","fork":false,"url":"https://api.github.com/repos/aerogear/data-sync-ui","forks_url":"https://api.github.com/repos/aerogear/data-sync-ui/forks","keys_url":"https://api.github.com/repos/aerogear/data-sync-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aerogear/data-sync-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aerogear/data-sync-ui/teams","hooks_url":"https://api.github.com/repos/aerogear/data-sync-ui/hooks","issue_events_url":"https://api.github.com/repos/aerogear/data-sync-ui/issues/events{/number}","events_url":"https://api.github.com/repos/aerogear/data-sync-ui/events","assignees_url":"https://api.github.com/repos/aerogear/data-sync-ui/assignees{/user}","branches_url":"https://api.github.com/repos/aerogear/data-sync-ui/branches{/branch}","tags_url":"https://api.github.com/repos/aerogear/data-sync-ui/tags","blobs_url":"https://api.github.com/repos/aerogear/data-sync-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aerogear/data-sync-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aerogear/data-sync-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/aerogear/data-sync-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aerogear/data-sync-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/aerogear/data-sync-ui/languages","stargazers_url":"https://api.github.com/repos/aerogear/data-sync-ui/stargazers","contributors_url":"https://api.github.com/repos/aerogear/data-sync-ui/contributors","subscribers_url":"https://api.github.com/repos/aerogear/data-sync-ui/subscribers","subscription_url":"https://api.github.com/repos/aerogear/data-sync-ui/subscription","commits_url":"https://api.github.com/repos/aerogear/data-sync-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/aerogear/data-sync-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/aerogear/data-sync-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/aerogear/data-sync-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/aerogear/data-sync-ui/contents/{+path}","compare_url":"https://api.github.com/repos/aerogear/data-sync-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aerogear/data-sync-ui/merges","archive_url":"https://api.github.com/repos/aerogear/data-sync-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aerogear/data-sync-ui/downloads","issues_url":"https://api.github.com/repos/aerogear/data-sync-ui/issues{/number}","pulls_url":"https://api.github.com/repos/aerogear/data-sync-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/aerogear/data-sync-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/aerogear/data-sync-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aerogear/data-sync-ui/labels{/name}","releases_url":"https://api.github.com/repos/aerogear/data-sync-ui/releases{/id}","deployments_url":"https://api.github.com/repos/aerogear/data-sync-ui/deployments","created_at":"2018-06-29T09:58:59Z","updated_at":"2018-08-16T13:34:40Z","pushed_at":"2018-08-17T11:51:53Z","git_url":"git://github.com/aerogear/data-sync-ui.git","ssh_url":"git@github.com:aerogear/data-sync-ui.git","clone_url":"https://github.com/aerogear/data-sync-ui.git","svn_url":"https://github.com/aerogear/data-sync-ui","homepage":null,"size":6279,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":10,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"aerogear:master","ref":"master","sha":"4aed49bfa591163a14191d4564392de04b6854f3","user":{"login":"aerogear","id":954205,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk1NDIwNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/954205?v=4","gravatar_id":"","url":"https://api.github.com/users/aerogear","html_url":"https://github.com/aerogear","followers_url":"https://api.github.com/users/aerogear/followers","following_url":"https://api.github.com/users/aerogear/following{/other_user}","gists_url":"https://api.github.com/users/aerogear/gists{/gist_id}","starred_url":"https://api.github.com/users/aerogear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerogear/subscriptions","organizations_url":"https://api.github.com/users/aerogear/orgs","repos_url":"https://api.github.com/users/aerogear/repos","events_url":"https://api.github.com/users/aerogear/events{/privacy}","received_events_url":"https://api.github.com/users/aerogear/received_events","type":"Organization","site_admin":false},"repo":{"id":139133264,"node_id":"MDEwOlJlcG9zaXRvcnkxMzkxMzMyNjQ=","name":"data-sync-ui","full_name":"aerogear/data-sync-ui","owner":{"login":"aerogear","id":954205,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk1NDIwNQ==","avatar_url":"https://avatars1.githubusercontent.com/u/954205?v=4","gravatar_id":"","url":"https://api.github.com/users/aerogear","html_url":"https://github.com/aerogear","followers_url":"https://api.github.com/users/aerogear/followers","following_url":"https://api.github.com/users/aerogear/following{/other_user}","gists_url":"https://api.github.com/users/aerogear/gists{/gist_id}","starred_url":"https://api.github.com/users/aerogear/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aerogear/subscriptions","organizations_url":"https://api.github.com/users/aerogear/orgs","repos_url":"https://api.github.com/users/aerogear/repos","events_url":"https://api.github.com/users/aerogear/events{/privacy}","received_events_url":"https://api.github.com/users/aerogear/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/aerogear/data-sync-ui","description":"UI for the AeroGear Data Sync server","fork":false,"url":"https://api.github.com/repos/aerogear/data-sync-ui","forks_url":"https://api.github.com/repos/aerogear/data-sync-ui/forks","keys_url":"https://api.github.com/repos/aerogear/data-sync-ui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aerogear/data-sync-ui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aerogear/data-sync-ui/teams","hooks_url":"https://api.github.com/repos/aerogear/data-sync-ui/hooks","issue_events_url":"https://api.github.com/repos/aerogear/data-sync-ui/issues/events{/number}","events_url":"https://api.github.com/repos/aerogear/data-sync-ui/events","assignees_url":"https://api.github.com/repos/aerogear/data-sync-ui/assignees{/user}","branches_url":"https://api.github.com/repos/aerogear/data-sync-ui/branches{/branch}","tags_url":"https://api.github.com/repos/aerogear/data-sync-ui/tags","blobs_url":"https://api.github.com/repos/aerogear/data-sync-ui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aerogear/data-sync-ui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aerogear/data-sync-ui/git/refs{/sha}","trees_url":"https://api.github.com/repos/aerogear/data-sync-ui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aerogear/data-sync-ui/statuses/{sha}","languages_url":"https://api.github.com/repos/aerogear/data-sync-ui/languages","stargazers_url":"https://api.github.com/repos/aerogear/data-sync-ui/stargazers","contributors_url":"https://api.github.com/repos/aerogear/data-sync-ui/contributors","subscribers_url":"https://api.github.com/repos/aerogear/data-sync-ui/subscribers","subscription_url":"https://api.github.com/repos/aerogear/data-sync-ui/subscription","commits_url":"https://api.github.com/repos/aerogear/data-sync-ui/commits{/sha}","git_commits_url":"https://api.github.com/repos/aerogear/data-sync-ui/git/commits{/sha}","comments_url":"https://api.github.com/repos/aerogear/data-sync-ui/comments{/number}","issue_comment_url":"https://api.github.com/repos/aerogear/data-sync-ui/issues/comments{/number}","contents_url":"https://api.github.com/repos/aerogear/data-sync-ui/contents/{+path}","compare_url":"https://api.github.com/repos/aerogear/data-sync-ui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aerogear/data-sync-ui/merges","archive_url":"https://api.github.com/repos/aerogear/data-sync-ui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aerogear/data-sync-ui/downloads","issues_url":"https://api.github.com/repos/aerogear/data-sync-ui/issues{/number}","pulls_url":"https://api.github.com/repos/aerogear/data-sync-ui/pulls{/number}","milestones_url":"https://api.github.com/repos/aerogear/data-sync-ui/milestones{/number}","notifications_url":"https://api.github.com/repos/aerogear/data-sync-ui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aerogear/data-sync-ui/labels{/name}","releases_url":"https://api.github.com/repos/aerogear/data-sync-ui/releases{/id}","deployments_url":"https://api.github.com/repos/aerogear/data-sync-ui/deployments","created_at":"2018-06-29T09:58:59Z","updated_at":"2018-08-16T13:34:40Z","pushed_at":"2018-08-17T11:51:53Z","git_url":"git://github.com/aerogear/data-sync-ui.git","ssh_url":"git@github.com:aerogear/data-sync-ui.git","clone_url":"https://github.com/aerogear/data-sync-ui.git","svn_url":"https://github.com/aerogear/data-sync-ui","homepage":null,"size":6279,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":10,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/111"},"html":{"href":"https://github.com/aerogear/data-sync-ui/pull/111"},"issue":{"href":"https://api.github.com/repos/aerogear/data-sync-ui/issues/111"},"comments":{"href":"https://api.github.com/repos/aerogear/data-sync-ui/issues/111/comments"},"review_comments":{"href":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/111/comments"},"review_comment":{"href":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/aerogear/data-sync-ui/pulls/111/commits"},"statuses":{"href":"https://api.github.com/repos/aerogear/data-sync-ui/statuses/6e880a37aeb78a4e352839de97899c9d5ca9dea7"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"josemigallas"}}