-
-
Notifications
You must be signed in to change notification settings - Fork 377
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
Cursor gets stuck when typing at the end of a line on an Android device #1358
Comments
We have recently updated codemirror-view to 6.24.1 4e355ea (previously using 6.21.4 5dfda8e) and we are getting a lot of reports for this issue as well. Lots of details and videos (inconveniently in zip files) at https://forum.obsidian.md/t/cursor-ends-up-before-the-letter-on-android-samsung-keyboard/78185 In addition, we are also seeing a similar issue on desktop with IMEs with details here, which I am also able to reproduce in the mixed-language demo page: https://forum.obsidian.md/t/problem-with-cursor-positioning-after-some-formatting-symbols-when-using-input-method-ime-cjk/78455 @marijnh Has this been reproducible at all? We would be grateful if you can take a look at it as we are getting a significant amount of users running into this, and our app store reviews has seem better days as well 😂. |
I have bisected the problem to be from the commit codemirror/view@4e355ea |
@marijnh Any workaround for this? Or should we just roll back codemirror/view to 6.24.1 for now? |
It looks like 6.26.1 already makes this less disruptive—the cursor still appears in the wrong place after starting a single letter, but continuing to type does the expected thing. The underlying issue here seems to be a bug in that virtual keyboard, which mispositions the cursor when the DOM changes right at the start of the composition, putting it before instead of after the typed character. Other keyboards like GBoard don't have this problem. |
I will update and test again in a few days, thanks! |
@marijnh Actually, spoke too soon! This is still broken for me. |
@lishid I see that Obsidian was able to workaround this bug for their latest 1.5.12 update. Was that accomplished by simply downgrading codemirror to a particular version? |
We have a fork on which I've performed a revert on the specific commit. |
@lishid Thanks! Following suit, we have also forked @codemirror/view and reverted commit codemirror/view@4e355ea to get things working again on Android devices. It's a bit difficult to maintain, but it'll do as a temporary workaround! @marijnh if there is some sort of configuration option we could utilize to skip this composition barrier logic, let us know! Otherwise, we'll just keep working off of a fork for now. |
FIX: Remove the workaround that avoided inappropriate styling on composed text after a decoration again, since it breaks the stock Android virtual keyboard. Issue codemirror/dev#1358 Issue codemirror/dev#1324
I haven't been able to find a way to fix #1324 without triggering this misbehavior in the virtual keyboard, so I went ahead and reverted that fix in 6.26.2. Experimenting with using |
Describe the issue
Reproduction Steps:
On an android device, load any codemirror editor that uses a language package. (The example editors on https://codemirror.net/examples/lang-package and https://codemirror.net/examples/mixed-language both exhibit this bug on my Android phone.)
Try typing
test
at the end of any line in the editor.Expected Result:
The word
test
is typed at the end of the line.Actual Result:
Because the cursor gets stuck for the first two characters, instead of typing
test
the editor typesstet
Additional Notes:
We noticed this bug in our editor after updating our codemirror packages to the latest version. This bug seems to only appear on Android. It works fine on iOS and desktop. It also seems to only happen in the language package examples on the codemirror website. The other examples work fine.
Browser and platform
Android, Samsung Galaxy 10+, Samsung Mobile Browser & Chrome Mobile Browser, Default android keyboard
Reproduction link
https://codemirror.net/examples/mixed-language
The text was updated successfully, but these errors were encountered: