CodeMirror editor on Android randomly swallows typed characters

  • TiddlyWiki 5.3.7 with a bunch of plugins including CodeMirror installed
  • Tiddloid 2.5.0

I’ve noticed this behavior on two different smartphones already, hence the topic.

When I’m typing text in Edit Tiddler mode with CodeMirror editor, it would randomly swallow typed characters. I look at the keyboard while typing a whole word, then look at the editor and sometimes I see random letters missing.

When the typed letter gets swallowed, in slow motion it looks like this:

  • I tap the key on the on-screen keyboard
  • I see it appearing in the editor textarea
  • after a visually noticeable fraction of second it gets auto-deleted, like if I’ve would explicitly pressed Backspace

Is this a known problem?

So far I have two blind assumptions, two suspects for the cause of this problem:

  1. The keyboard app. I don’t use the vanilla Google keyboard, I use Hacker’s Keyboard. But I never noticed this problem when typing in any other app.
  2. CodeMirror Autocomplete subplugin. I did not try to disable it yet (and frankly, I’m not really using it, I think I installed it together with the rest of subplugins, out of curiousity), I’d like to get some feedback first before attempting a test drive with this subplugin disabled.

Perhaps share the version of code mirror in use. Codmirror6 is also out there.

CodeMirror is version 5.3.7 as well, installed from the official TiddlyWiki plugin library

No. I did read about this phenomenon the first time here.

As you suggested, you should try to disable plugins and see what happens. But …

This hints a different synchronisation problem. If the code mirror editor is shown, in reality there are 2 editors active. The default text input field is hidden, but needs to be updated. Since you can see, that character in the cm-editor and it disappears after some time it seems the sync between cm-editor and the hidden text input field is corrupted.

Are there any other plugins, that may have / need access to the default text-input in the edit template?
Did you change the Hidden Setting: Typing Refresh Delay to a very low or very high number?
Do you use throttle.refresh field in those tiddlers?
How old is the android device?

I do know this problem. When setting $:/config/inputStyle to contenteditable, both on iPadOS and on Windows swallows typed latin characters if you types a Chinese word with pinyin then type some latin characters.

This doesn’t happen in codemirror6.

I don’t know the answer to this question. How to capture the list of installed plugins into a copy-paste friendly string?

No and No.

I have noticed this on a 4-5 years old device running MIUI 12 (Android 10) and on a newer device with HyperOS 2.0 (Android 15).

Happens to me when I type in English only.

I do indeed have the setting you mention: CodeMirror and text selection problems on Android

IMO the bug affects IME’s autocompletion. I don’t know how it behaves when using English input mehod, this is how codemirror behaves when using Chinese pinyin input method:

动画

On v5.3.7, you can go to ControlPanel → Info → Wiki Information to generate a wiki report. The report will generate wiki’s information, including all the plugin you installed.

2 Likes
Wiki Information

TiddlyWiki Version: 5.3.7
Current palette: $:/wilk/palettes/GraphiteDark090
Current theme: 
Current layout: 
Browser language setting: en-US
Default type for missing tiddlers: 
Auto save setting: yes
Code wrapping setting: pre
Sticky titles setting: no
Sidebar layout setting: fixed-fluid
Auto focus field setting for new tiddlers: title
Current storyview setting: classic
Toolbar text setting: no
Toolbar icon setting: yes
Button class setting: tc-btn-invisible
Navigation address bar setting: no
Tiddler opening behaviour setting for navigations from outside the story river: top
Tiddler opening behaviour setting for navigations from within the story river: below
CamelCase linking setting: enable
Keyboard shortcuts that have been customised: 
Disabled plugins: $:/plugins/ahanniga/find-in-page-plugin,$:/plugins/ihm/tidgraph,$:/plugins/wikilabs/tocP
Plugins: 
  $:/core - 5.3.7
  $:/plugins/danielo515/encryptTiddler - 2.5
  $:/plugins/flibbles/relink - 2.4.4
  $:/plugins/flibbles/relink-fieldnames - 2.4.1
  $:/plugins/flibbles/relink-markdown - 2.4.0
  $:/plugins/flibbles/relink-titles - 2.4.0
  $:/plugins/flibbles/relink-variables - 2.4.1
  $:/plugins/Gk0Wk/CPL-Repo - 2025.03.29
  $:/plugins/hoelzro/full-text-search - 1.1.0-4-g954307a
  $:/plugins/hoelzro/progress-bar - 0.0.1
  $:/plugins/kookma/commander - 2.1.13
  $:/plugins/sq/streams - 1.2.24
  $:/plugins/tiddlywiki/codemirror - 5.3.7
  $:/plugins/tiddlywiki/codemirror-autocomplete - 5.3.7
  $:/plugins/tiddlywiki/codemirror-closebrackets - 5.3.7
  $:/plugins/tiddlywiki/codemirror-closetag - 5.3.7
  $:/plugins/tiddlywiki/codemirror-mode-css - 5.3.7
  $:/plugins/tiddlywiki/codemirror-mode-htmlembedded - 5.3.7
  $:/plugins/tiddlywiki/codemirror-mode-htmlmixed - 5.3.7
  $:/plugins/tiddlywiki/codemirror-mode-javascript - 5.3.7
  $:/plugins/tiddlywiki/codemirror-mode-markdown - 5.3.7
  $:/plugins/tiddlywiki/codemirror-mode-xml - 5.3.7
  $:/plugins/tiddlywiki/codemirror-search-replace - 5.3.7
  $:/plugins/tiddlywiki/codemirror-trailingspace - 5.3.7
  $:/plugins/tiddlywiki/highlight - 5.3.7
  $:/plugins/tiddlywiki/markdown - 5.3.7
  $:/plugins/vuk/TW-UnitTest - 0.0.47
  $:/plugins/wikilabs/bundler - 1.2.0
  $:/plugins/wikilabs/field-editor - 1.1.0
  $:/plugins/wikilabs/field-visibility - 1.0.1
  $:/plugins/wikilabs/trails - 1.1.1
  $:/plugins/wilk/copy-code-button - 1.0.3
  $:/plugins/yaisog/ancestors-filter - 0.9.0
  $:/plugins/yaisog/descendants-filter - 0.9.0
  $:/temp/info-plugin - 
  $:/themes/tiddlywiki/snowwhite - 5.3.7
  $:/themes/tiddlywiki/vanilla - 5.3.7

Can not see anything suspicious in the plugin overview. :face_with_monocle:

Throttle refresh is always enabled for draft tiddlers, see https://tiddlywiki.com/#RefreshThrottling.

I know, and 400ms is the default value, which updates the TW store.

@vuk … may be you try 1000 or 2000 for $:/config/Drafts/TypingTimeout – Just as a test. May be you see something. If the “character overwrite” changes accordingly, than we definitely know, there is syncing problem between the editors.

Ok, I’ll do that and report back if I notice any change.

Problem noticed again while the value of $:/config/Drafts/TypingTimeout is 1000.

I’ll increase it to 2000.

Been driving a wiki for a week with 2000 TypingTimeout (see above). While I’m not 100% sure this completely fixes the issue, the situation is much, much better. Thanks for the suggestion @pmario