New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incorrect cursor position on wrapped lines for some users with Chrome #1642
Comments
+1 I've observed the same issue: On FF everything is fine, but on Chrome (more specific: Chromium on a 64 bit Linux machine) the cursor is off by one ore more characters if the line is wrapped. |
Which version of Chrome is this? It looks like https://code.google.com/p/chromium/issues/detail?id=246127 , which I reported but they didn't manage to fix in 28. If 27 (which is the current stable version) is also affected, that would be good to know. In any case, feel free to pile on the chromium bug report in an attempt to get them to fix this in 28 at least. |
Chromium 28.0.1500.52 (Developer Build 207119) |
Okay, 28, which is a beta if I understand correctly. I'm going to hope that someone in the Chromium team wakes up soon enough to prevent this from making it into the stable release. Even if that fails, I'm pessimistic about being able to fix this on the CodeMirror side. |
Many thanks for your help with this. I have voted for the Chromium bug. We've had users report this on |
I'm able to reproduce this on Chrome 28 on Mac, if anyone needs help troubleshooting. |
Seeing this issue on Chrome 28.0.1500.71 on OSX. |
The next Chrome 28 update should fix this (at least, that's what they promised in the Chrome issue discussion). I am not sure when it will come out (and whether it will actually work) yet. |
I've checked it in 28.0.1500.95, which hit stable today, on Mac and Windows, and it now seems to be fixed. |
Can confirm this works too. Test: Hooray!! 👍 |
Confirming that this has been fixed as of Chrome stable 28.0.1500.95 |
Great. I'll leave this open for a few more weeks until the majority of Chrome users have upgraded. |
Chrome 29 is released today and the issued is fixed from chrome side. |
I could still reproduce something similar in Chrome 29 and Canary 31, see #1787. |
Hi this issue is still happening and it's now 2015. |
Triggering a resize event whenever I wanted the cursor to go to the correct position worked for me: |
You can also call |
I'm still suffering this issue. I have tried with Any other solution? |
Submit a self-contained demo that makes it easy for me to reproduce this, and I'll look into it (mention browser version etc) |
I'm using it along with other libraries. Should I include them in the demo as well ? |
Only if they are necessary to cause the problem to happen. |
Hello @marijnh Let me know if this is too complex http://tiddlywiki.com/plugins/tiddlywiki/codemirror/index.html
Regards |
You don't appear to be calling |
Hello @marijnh, I'm not sure of the refresh() on that particular example, but I'm sure that in the other place where I'm using code-mirror I am triggering the refresh. Let me build an example and I'll post it here. |
I think this might be a related example but I am getting the cursor jumping as well. Chrome 49.0.2623.112 m Here's a video of it in action. |
Does a call to |
I am still having what seems a related problem in 2017. You can see this at http://www.textualcommunities.org/app/community/?id=57598982b952f25827bd401c&route=view |
Your cursor is being reset to the start of document somehow. This has nothing to do with this issue. It's likely something that your code does, but if you can reproduce it in a plain CodeMirror, feel free to open another issue. |
For anyone else who comes across this... Had a problem with this. I think it has to do with the way I lay everything out and the code mirror container changing sizes when I set the value. If I use the following code, it resolves the issue: var editor = CodeMirror.fromTextArea(...)
editor.on('change', () => {
setTimeout(() => {
editor.refresh()
})
})
editor.setValue(...) |
I can reproduce the issue in Chrome 76+, and none of the hacks above, either calling It worked fine in Chrome 74 (didn't try 75). |
I encountered the same problem with Chrome 87 After trying out different solutions - the below solved it for me:
the solution suggested above with setTimeout did not work....! |
We've had several reports of the cursor not appearing in the right place on wrapped lines in Chrome (as evidenced by inserts / deletes happening elsewhere). I still can't reproduce these issues, but now one of our users has submitted screenshots illustrating it on the CodeMirror b-tree demo, which may be of some help.
Unlike #1219, the string doesn't have any non-ASCII characters. It's just:
Interpolants are logical assertions over program states that can separate program states that satisfy a desired propert from one that violate the property.\
Unlike #1353, it only seems to affect some users -- and never me, so far.
The first screenshot shows the apparent position of the cursor, after 'y' in 'satisfy':
The second screenshot shows the result of pressing backspace:
The expected result was that the 'y' would be deleted, but the 'f' before the 'y' was deleted instead.
The information I have collected from users so far:
I thought it might be related to the user's locale, but I could not reproduce the issue on a French Windows 7 (up-to-date SP1) running a French Chrome (27.0), which matches this user's setup, so that does not appear to be the case.
I'll keep trying to get more information about this from the users who report it -- I'm sorry that there's not much to go on yet, but I figured I'd report it here to see whether anyone has any ideas.
The text was updated successfully, but these errors were encountered: