Fix autocomplete not triggering on mobile (CM5 input handling)#4017
Fix autocomplete not triggering on mobile (CM5 input handling)#4017raclim merged 2 commits intoprocessing:developfrom
Conversation
|
@raclim would appreciate your thoughts here as well, especially since this relates to the earlier discussion around mobile autocomplete behavior, thanks! |
raclim
left a comment
There was a problem hiding this comment.
Thanks so much for your collaboration on this @aashu2006 and @skyash-dev, it's really awesome to see how the both of you pulled this together! I think this looks great, and will hold the fort until CM6 comes out!
|
@aashu2006 last time when i tested this mobile keyboard issue was not solved... is this solved? ref: "the keyboard closes when the hint menu appears because focus seems to shift away from the editor. i tried removing .click() usage, preventing default on hint interactions, and simplifying to e.pick()-based selection, but it still closes the keyboard." |
|
@skyash-dev Yes, the autocomplete trigger part is fixed now, but the keyboard still closes on mobile when the hint menu appears. I did try few approaches like refocusing after we handle this as a follow up PR since it’s a separate issue from the trigger fix. |
Issue:
Fixes #4007
This PR builds on the issue identified and discussed by @skyash-dev and me at Discord. We focused on investigating the mobile input behavior in CodeMirror and then I implementing a fix for the autocomplete trigger.
Autocomplete suggestions were not triggering reliably on mobile devices due to differences in CodeMirror’s input handling (IME + contenteditable path in CM5)
Demo:
Tested on a real Android device (Chrome). Autocomplete now appears while typing with the virtual keyboard.

Changes:
change(desktop input)compositionend(word commit on mobile)compositionupdate(IME typing support)triggerHinthelper to unify logic"bac "to ensure correct token detectionNotes:
I have verified that this pull request:
npm run lint)npm run test)npm run typecheck)developbranch.Fixes #123