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
Can't input Japanese on iOS #379
Comments
|
Chinese too, the empty line stays empty on composition end. iOS 14.3. |
|
@marijnh I would love to contribute but where should I look into it? |
|
At a glance, I think this is related to the way selection and composition interact on iOS. It appears that the composed text is being selected (which doesn't happen on most platforms), and that the Enter press is somehow deleting that selection. A good direction to start would be to test (possibly on a plain contentEditable element to avoid confusion) what the DOM selection is supposed to be when inputting text via the Kanji keyboard, and what kind of events are fired when you press enter there (most platforms don't fire keydown events during composition, but Safari has some odd behavior there). |
|
I found that when inputting Chinese, iOS Safari doesn't fire Start composing: Continue composing: Confirm composition: There's also different behavior when the whole composition is deleted Delete last existing character of composition: |
|
After more experiments I've concluded that on iOS Safari the composed text is not selected; that is selected only during |
|
It could be that patch codemirror/view@75ae928 has made this better—at least, it doesn't seem to behave like in the screencast anymore. Could someone who is experienced with this type of virtual keyboard take another look with |
|
Thank you for taking the time to fix it! I've tried it but it is still not working: RPReplay_Final1614341282.MP4I confirmed that I'm on |
|
I can confirm that on finishing a composition its text is removed. Not a lot of progress in figuring out why, though—it appears to just vanish from the DOM, before the editor does anything. Will spend more time on this later. |
|
I think I got it (see codemirror/view@9ed075a). The browser would delete the composed text when confirming the composition, deliver the DOM mutation events for that deletion, and then reinsert it (for some reason). CodeMirror would, when seeing the deletion, move the cursor, which apparently prevented the reinsertion from happening. Slightly delaying the handling of mutation events during composition seems to avoid the problem. |
|
Thank you, @marijnh, it works! RPReplay_Final1614949868.MP4I guess that's due to those deletion & reinsertion behaviors. |
|
I found similar case case.mov
iOS 14.4 safari |
FIX: Fix an issue where, at the end of a specific type of composition on iOS, the editor read the DOM before the browser was done updating it. Issue codemirror/codemirror.next#430 Issue codemirror/codemirror.next#379
|
Thanks for the number-based reproduction instructions—those were a lot easier for me to follow. Attached patch (released as @codemirror/view 0.18.2) seems to solve that case. Please take a look and let me know whether you are still seeing things like this. (If so, please explain them as you would to someone who doesn't know anything about your writing system, because I have a lot of trouble even figuring out what's going on with most of these instructions.) |
|
Thanks! sample.mp4
|
|
The new problem doesn't happen for Chinese so I'm outta here. |
|
That's the same reproduction sequence as before, right? With the current code, on this iPhone (iOS 14.4.1), I'm now seeing this behave as expected (the 456 isn't duplicated). |
|
There is similar issue when typing Korean on iOS Safari. 20210425_004201672.mp4 |
|
I can see this problem on the version on the website, but can't reproduce this with the current code anymore. I've updated the website. Could you take a look to see if it's better now? |
|
It's better! But #379 (comment) still persists. |
|
@craftzdog I'm going to need more detailed instructions to reproduce that. When I press the top-left character multiple times, it changes the character before the cursor, rather than inserting multiple copies, so I can't even start the sequence shown in that video. (In general, I much prefer written reproduction steps to videos, especially fast-moving ones like that one.) |
|
@marijnh Sure.
Expected resultActual result'嗚呼' disappears. Can you reproduce that? |
|
If I press あ I get a different character replacing the first あ, not two あs. That is with the Japanese Kana keyboard, which looks like the one you showed in the screencast. |
|
Change to 'い' if press 'あ' twice quickly. - 1. Press 'あ' x 2, procucing 'ああ'
+ 1. Press 'あ', Wait 2 seconds or press '→', Press 'あ', procucing 'ああ'
2. Press '次候補', meaning the next conversion. '嗚呼' should be highlighted. But do not press '確定' (submit).
3. Press 'か''→' key is localed this |
|
Sorry, I didn't mention that I'm using the Flick Only option of the Kana keyboard. |
…uccession on iOS Since that would cause the browser to replace the content of the first composition. FIX: Fix a bug where some types of IME input on Mobile Safari would drop text. Issue codemirror/codemirror.next#379
|
Finally got around to looking into this. With that option I could reproduce the problem. Apparently, the browser would when you typed the third character, end the composition, move the selection to cover those two characters, and then start a new composition that inserted the third character. CodeMirror would conclude, when the first composition ended, that it needed to sync the selection, and that ended up breaking the effect of the second composition. Attached patch seems to help. |
|
Thanks for the fix! I found that it's solved for the previous case with '嗚呼か'.
Expected resultActual resultWhen pressing 'は' in step 3, the cursor moves back to the head of the line and '赤い' does not get inserted.
|
|
Besides @craftzdog's '赤い花' problem (it's very weird..), the problem @ttakuru88 mentioned above remains in my environment (iOS 14.6).
RPReplay_Final1623118294_d.mov |
|
@craftzdog @iiz00 I don't know which virtual keyboards you are using there. If the problem still shows up with recent @codemirror/view versions, please file new, separate github issues with a detailed textual description of how you get them to occur and, if not obvious, what you'd expect to happen. (Again, I only speak Latin-script languages and my most advanced routine use of IME is adding basic accents with the X multi key.) Closing this since it has become an unfocused grab-bag of different issues. |

I'm excited to try CodeMirror 6!
I found that it can't input Japanese on iOS (14.3) if a line is empty.
I've attached a video here:
RPReplay_Final1611395076.MP4
You can reproduce it on the website of CodeMirror 6.
The text was updated successfully, but these errors were encountered: