Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

on ipad with wireless keyboard, cursor movement disabled #363

Closed
dyoo opened this Issue Feb 11, 2012 · 20 comments

Comments

Projects
None yet
7 participants
Contributor

dyoo commented Feb 11, 2012

On an iPad 2 connected to a wireless keyboard, the user can type into a CodeMirror 2 area, but cannot use the cursor keys to go up, down, left, or right.

Owner

marijnh commented Nov 29, 2012

Closing this until another report of the same issue comes up.

@marijnh marijnh closed this Nov 29, 2012

benca commented Jan 13, 2013

I see the same issue.

iPad 3, iOS 6.1
Latest versions of Chrome for iOS and Mobile Safari.
If you use the arrow keys to go left and right or up and down, the cursor itself moves (i.e., you will type where you just moved to), but the blinking bar remains where it originally was.

ETA: tapping on a certain position moves the physical cursor and you will actually type where it is.

Owner

marijnh commented Jan 14, 2013

That's odd. Is there any way to see whether error messages are generated? If the key's action goes through, but the display isn't updated, I can only explain that if the script errored out somewhere in the process of handling that key.

@marijnh marijnh reopened this Jan 14, 2013

benca commented Jan 14, 2013

There is a way of getting to the developer console. On the surface, no exceptions or errors are generated by using the arrow keys, but I can go through what's happening and take a closer look.

This looks like the relevant section of the code - is there somewhere specific you recommend I start looking?

Owner

marijnh commented Jan 14, 2013

At some point, for example for the left arrow, CodeMirror.commands.goCharLeft will be called. Then, after that, endOperation should trigger a call to updateSelection, which will redraw the cursor based on its current position. It sounds like the call to goCharLeft goes through, but the selection somehow isn't udpated.

benca commented Jan 22, 2013

So I want to do more on this but some tests indicate that the iPad is not sending the charcodes at all. But, it looks like the behavior differs based on whether the editor is created with fromTextBox or by calling the constructor and having it append some element with the editor. I am going to try and run a few test cases to see what exactly is going on here...

zyavrik commented Feb 14, 2013

I have added alert(e.KeyCode) to onKeyDown event - and it doesn't work at all on arrow keys. All other keys work fine. Why??? How to fix this issue?

Related question: http://stackoverflow.com/questions/14861034/arrow-keys-dont-work-on-javascript-on-uiwebview

Contributor

schanzer commented Feb 14, 2013

No, this is unrelated.

zyavrik commented Feb 14, 2013

schanzer, why do you think so? Did you fix this issue on your version of CodeMirror for iOS?

Contributor

schanzer commented Feb 14, 2013

I haven't been able to test this with my plugin -- I'm just saying this behavior happens on native CM, and is not related to the plugin code. I would investigate, but I don't have a wireless keyboard to test with.

zyavrik commented Feb 14, 2013

schanzer, where may I try your version for iOS? Obsolete link http://www.litech.org/~schanzer/iOS/ doesn't work.

zyavrik commented Feb 14, 2013

Another issue like this. Run mobile Safari, open CodeEditor, type anything, press Up key or Shift+Up key, press any char key again. You will see it before the first entered char (Up) or all entered chars will be replaced by it (Shift+Up).

Contributor

schanzer commented Feb 14, 2013

http://www.litech.org/~schanzer/CodeMirror/demo/iOS.html
(some issues on iOS 5, but iOS6 works quite well)

zyavrik commented Feb 14, 2013

Arrow keys don't work on it too:(

Contributor

schanzer commented Feb 14, 2013

Of course not. My plugin isn't doing any magic. It's a bunch of smoke and mirrors, but the goal is to use CodeMirror pretty much unmodified, so any bugs you see without the plugin will also appear with it. :)

zyavrik commented Feb 15, 2013

I think we should simplify CodeMirror script until issue goes off to find what cause it.

zyavrik commented Feb 19, 2013

Does anybody plan to fix this issue? I'll be glad - but don't know javascript enough for that:(

rcarmo commented Nov 19, 2013

I can confirm this is still happening with the latest release and iOS 7.0.x. My current workaround is to enable vim mode (which works OK for me but is sure to annoy loads of people).

I just acquired a new iPad Air (iOS 7.0.4)and I can confirm this issue is happening in Logitech Ultrathin keyboard cover. The arrows are not working. I've detected this while visiting https://codio.com as it seems that it is using CodeMirror for their Web IDE. Very annoying since I was hopping to code straight from the iPad. Does anyone know if this is an issue in android tablets to?

@marijnh marijnh added the mobile label Oct 20, 2014

Owner

marijnh commented Feb 24, 2015

Should be much better now that the contentEditable-based mobile code has landed.

@marijnh marijnh closed this Feb 24, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment