{"action":"created","issue":{"url":"https://api.github.com/repos/ProseMirror/prosemirror/issues/702","repository_url":"https://api.github.com/repos/ProseMirror/prosemirror","labels_url":"https://api.github.com/repos/ProseMirror/prosemirror/issues/702/labels{/name}","comments_url":"https://api.github.com/repos/ProseMirror/prosemirror/issues/702/comments","events_url":"https://api.github.com/repos/ProseMirror/prosemirror/issues/702/events","html_url":"https://github.com/ProseMirror/prosemirror/issues/702","id":262766680,"number":702,"title":"Arrow keys moves cursor to unexpected positions","user":{"login":"mirrec","id":544111,"avatar_url":"https://avatars0.githubusercontent.com/u/544111?v=4","gravatar_id":"","url":"https://api.github.com/users/mirrec","html_url":"https://github.com/mirrec","followers_url":"https://api.github.com/users/mirrec/followers","following_url":"https://api.github.com/users/mirrec/following{/other_user}","gists_url":"https://api.github.com/users/mirrec/gists{/gist_id}","starred_url":"https://api.github.com/users/mirrec/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirrec/subscriptions","organizations_url":"https://api.github.com/users/mirrec/orgs","repos_url":"https://api.github.com/users/mirrec/repos","events_url":"https://api.github.com/users/mirrec/events{/privacy}","received_events_url":"https://api.github.com/users/mirrec/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-10-04T12:21:07Z","updated_at":"2017-10-04T14:47:10Z","closed_at":"2017-10-04T14:15:14Z","author_association":"NONE","body":"Hello,\r\n\r\nfirst of all, ProseMirror looks awesome! Great work!\r\n\r\n\r\n### Issue details\r\n\r\nIn text editor, when you put your cursor on some possition (1st row, 10th character), and you press arrows down or up, row number changes. But character / column  number should keeps the same (if it is possible). If it is not possible (line below or above is shorter) it should goes to the end of the line, and get back to the 10th character on some next line, when possible (line is long enough).\r\n\r\nThis is not the case in ProseMirror.\r\n\r\nI made a [screencast](https://www.youtube.com/watch?v=02J-9QpAqIM) to describe problems. I hope it will help. Basically there are 3 issues. Here is text description.\r\n\r\n1. Cursor is not keeping column on different lines. (all tested browsers)\r\n2. When there is empty paragraph 'on the way' from up to down, cursor moves to beginning of paragraph, even it should follow character number. (chrome, safari and IE)\r\n3. Cursor jumps to unexpected position when we are on the first or last line of document (chrome and safari)\r\n\r\n### Steps to reproduce\r\n\r\n#### Issue 1\r\n\r\n> Cursor is not keeping column on different lines.\r\n\r\n1. open prosemirror.net in Chrome\r\n2. copy & paste this text to the editor\r\n\r\n```\r\nLike this one!\r\nshort text\r\nTry it out by typing in here or see more examples.\r\n```\r\n\r\n3. Put cursor on the last line after 4th character: 'Try <CURSOR>it'\r\n4. Press arrow up, and you will be on the 3rd character of previous line: 'sho<CURSOR>rt'. Eventhough it should be on the 4th character.\r\n5. So cursor is now at 3rd character at 'sho<CURSOR>rt'.\r\n6. When you press arrow up key, you get to the first line, but to the 4th character: 'Like<CURSOR>'.\r\n\r\n#### Issue 2\r\n\r\n> Empty paragraph break keeping column position on the way down\r\n\r\n1. open prosemirror.net in Chrome\r\n2. copy & paste this text to the editor\r\n\r\n```\r\nLike this one!\r\nshort text\r\nTry it out by typing in here or see more examples.\r\n```\r\n\r\n3. add empty line after second line, so text should look like this\r\n\r\n```\r\nLike this one!\r\nshort text\r\n\r\nTry it out by typing in here or see more examples.\r\n```\r\n(I am not able to copy & paste empty line, so it has to be done manualy)\r\n\r\n4. put your cursor to the end of the first line: '...one!<CURSOR>'\r\n5. press down arrow key 3 times, and you end on last line with cursor on before first character: '<CURSOR>Try'. Even though it should be here: 'by <CURSOR>typing'\r\n\r\n#### Issue 3\r\n> Cursor jumps to unexpected position from first or last line of document\r\n\r\n1. open prosemirror.net in Chrome\r\n2. copy & paste this text to the editor\r\n\r\n```\r\nLike this one!\r\nshort text\r\nTry it out by typing in here or see more examples.\r\n```\r\n\r\n3. put your cursor to the end of the first line: '...one!<CURSOR>'\r\n4. press arrow up: it will put cursor to the beginning of the first line (this is correct): '<CURSOR>Like'\r\n5. now press arrow down, and get to the end of the first line '...text<CURSOR>'. You should be on the beginning of this line.\r\n\r\n### Please specify which version of ProseMirror you're running\r\n\r\nProseMirror v 0.24\r\n\r\n### Affected platforms\r\n\r\n- [x] Chrome 60\r\n- [x] Firefox 56\r\n- [x] Safari 10.1.1\r\n- [x] Internet Explore 11\r\n\r\n\r\n### Screencast (Optional)\r\n\r\nhttps://www.youtube.com/watch?v=02J-9QpAqIM"},"comment":{"url":"https://api.github.com/repos/ProseMirror/prosemirror/issues/comments/334179990","html_url":"https://github.com/ProseMirror/prosemirror/issues/702#issuecomment-334179990","issue_url":"https://api.github.com/repos/ProseMirror/prosemirror/issues/702","id":334179990,"user":{"login":"marijnh","id":144427,"avatar_url":"https://avatars3.githubusercontent.com/u/144427?v=4","gravatar_id":"","url":"https://api.github.com/users/marijnh","html_url":"https://github.com/marijnh","followers_url":"https://api.github.com/users/marijnh/followers","following_url":"https://api.github.com/users/marijnh/following{/other_user}","gists_url":"https://api.github.com/users/marijnh/gists{/gist_id}","starred_url":"https://api.github.com/users/marijnh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marijnh/subscriptions","organizations_url":"https://api.github.com/users/marijnh/orgs","repos_url":"https://api.github.com/users/marijnh/repos","events_url":"https://api.github.com/users/marijnh/events{/privacy}","received_events_url":"https://api.github.com/users/marijnh/received_events","type":"User","site_admin":false},"created_at":"2017-10-04T14:47:10Z","updated_at":"2017-10-04T14:47:10Z","author_association":"OWNER","body":"You could detect the situation where arrow-up puts the cursor at the start of the document (in a keyup handler, possibly), and reset the DOM selection at that point (clear it and reset it to its old range) to make it forget about the previous vertical position."}}
{"actor":{"display_login":"marijnh"}}