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
Android Chrome Backspace and Enter do not fire keydown events #2234
Comments
I think the answer to whether this is practical/possible is on these lines: |
See the discussion (near the end) in #1196. I tried something like this, and was told it didn't work. |
What if the textarea always had a single space value " " with the cursor after it and we just listened for event changes? Can I immediately clear input and never actually show the textarea value? It shouldn't cause too many problems considering that selection doesn't work at all for mobile devices anyway. Is that the same concept used for that last attempt: 532c8f3 ? |
Yes. You can check out commit 3eef299 and experiment with that, it implements pretty much what you describe (always putting an underscore character at the start of the textarea). |
(To clarify, I mean the commit I linked is the last one that has the hack in it, the commit after it reverts it.) |
Did you edit which commit that was? I found what you were talking about here: 3c3003c It works for the first time you backspace on Android Chrome, but then obviously the textarea is empty again. I tried a couple things also, and came to realize that you will need to reset that '_' part of the textarea and prevInput upon every backspace (Also I think I saw backspacing over newlines showing a different behaviour). |
Is this still happening in recent Android versions? |
I can check right now.
|
Yes, this is still a relevant bug tested on v4.6 from http://codemirror.net The issue as researched before, lies in the fact that an invisible This means that as you type the characters you type are inserted into the It was discussed that this might be solved by initiallizing the input with
|
hey guys! any workaround for this for contentEditable? Seems like there is no way any text editor is going to support Android with this mess right? |
This problem is solved for Chrome in the current mobile code. (Though Firefox Android still has a similar issue - #3102) |
Awesome! Thanks!
|
The only way Backspace works is when your
.CodeMirror textarea:focus
has a non-empty value and it still doesn't fire akeypress
event it fires aninput
event.So when you begin typing, CodeMirror shows your current typing from the textarea (textarea has value), allowing you to back space. But once the
<textarea>.value
is empty you can't make any backspaces because no events are fired. Whenever you move your cursor to another location, the text area is reset:value=""
Is there any way that the textarea can hold a portion of the document where ever your cursor is or is re-located? Or are there any tips on how this can be done efficiently?
This applies to v3 and v4
The text was updated successfully, but these errors were encountered: