Skip to content

[Edtior] IME causes double text input #268

@Bistard

Description

@Bistard

Describe the bug

  • When typing a slash (/) in an empty paragraph while using a Chinese (or other IME-based) keyboard input method, the editor occasionally inserts two slashes (//) instead of just one. This behavior seems somewhat random and is more likely to occur when using an IME rather than a direct English keyboard layout.

This seems like hard to reproduce in different computers, I found out this bug in my laptop, but cannot reproduce in my desktop. Both are Windows 11.

Steps to Reproduce

  1. Switch the keyboard input method to Chinese (or another IME).
  2. Place the cursor in an empty paragraph within the editor.
  3. Type the slash character /.
  4. Notice that sometimes two slashes // appear, even though only one slash was pressed.

Expected Behavior
Only a single slash (/) should be inserted.

Actual Behavior
Randomly, two slashes (//) end up in the editor.

Additional Information / Observations

  • The bug only occurs when using an IME; with a purely English keyboard layout, typing / seems to work correctly.
  • During debugging and listening to compositionstart / compositionend, sometimes the second unexpected text input occurs after compositionend event is triggered.
  • Attempts to delay focusing or call view.focus() via setTimeout did not resolve the issue.
  • This suggests that the input method may be sending two events internally (composition events, then a final input event) which causes the double insertion.

Environment

  • Editor: ProseMirror
  • Operating System: Windows 11
  • Browser: Chrome
  • Input Method: Chinese Pinyin

Screenshots / Logs

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingdebugeditorminilow priority or does not affect main functionality

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions