First of all very nice program, I like it a lot! I am trying to integrate CodeMirror in an Android application (testing on 2.2), and it seems the Enter key is not working. All other characters do work though. I checked the onkeypress and onkeydown methods and it seems it they do not recieve the event/event keycode for Enter. So for some reason it doesn't read the input, I tried attaching the newlineAndIndent method to the Backspace and that works, so I don't think there is a fault in the code, it just doesn't recieve the Enter event. If someone knows how to solve this, that would be really great!
edit: the enter key event is however detected in other normal textareas and input fields (with onkeypress/onkeydown), so clearly Android does send the key event right.
This is issue #331 [1]. I can't reproduce it on my Android 2.3 phone,
so I guess it's a bug / issue in 2.2 and lower. If someone with access
to a 2.2 device could further debug it, that'd be great.
On Wed, Aug 29, 2012 at 10:22 AM, Matt Pass <m...@web-jedi.co.uk> wrote:
> I also found Enter doesn't do anything in CM on on Android 2.2 (tested on a
> mobile).
> Works fine on Android 3 (on a tablet) and Android 4 (on a mobile) if that
> helps find the issue.
> --
> You are receiving this because you are currently a member of the CodeMirror
> Google group. To send something to list, use codemirror@googlegroups.com, to
> unsubscribe, send a message to codemirror-unsubscribe@googlegroups.com.
Thanks for the quick responses. I would be happy to try to bugfix it but I am not sure how to go about this properly... I tried clearing most of the functions while still trying out the keys, hoping for the enter keypress to be triggered, but that didn't happen, even after I emptied most of the code. How would I properly debug this? And is there any javascript in the code that could possibly intercept an onkeypress or onkeydown event to be triggered?
Also there is the Android Virtual Device in the Android SDK that can emulate version 2.2 of Android, if anyone wants to help with that.
Hm, if the browser is simply not firing events at all, that might be
tricky to debug. You could try removing style rules (making the hidden
textarea visible) to see if that changes anything.
In the meantime, I'll put 'install the Android SDK' on my to-do list.
On Wed, Aug 29, 2012 at 2:17 PM, douve <dljvan...@gmail.com> wrote:
> Hi,
> Thanks for the quick responses. I would be happy to try to bugfix it but I
> am not sure how to go about this properly...
> I tried clearing most of the functions while still trying out the keys,
> hoping for the enter keypress to be triggered, but that didn't happen, even
> after I emptied most of the code. How would I properly debug this? And is
> there any javascript in the code that could possibly intercept an onkeypress
> or onkeydown event to be triggered?
> Also there is the Android Virtual Device in the Android SDK that can emulate
> version 2.2 of Android, if anyone wants to help with that.
> Douve
> --
> You are receiving this because you are currently a member of the CodeMirror
> Google group. To send something to list, use codemirror@googlegroups.com, to
> unsubscribe, send a message to codemirror-unsubscribe@googlegroups.com.
Lol sorry, the android device I am using is actually *2.3.3* (API 10), for some reason I thought it was 2.2 =/. I tried 2.3.3 on the Android Virtual Device and the enter key does not work there also.
I also tried clear the css with only the position:absolute in the .CodeMirror-gutter and CodeMirror pre.CodeMirror-cursor left. Every key still works except for enter, so it seems it is a problem in the javascript.
I somehow managed to solve the enter key problem by removing* padding: 0;*from *var input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em"); *and removing *overflow: hidden; *from *var inputDiv = elt("div", [input], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); *Then there appears a line under the cursor, to solve that you can set *height: 0; *in var input.
Only a new small problem arises: at the second time (and afterwards) of clicking on a line, the cursor dissapears. It shows up again after pressing a key. But it's not a very big problem, atleast it is possible to edit code now!