ProseMirror / prosemirror

The ProseMirror WYSIWYM editor
http://prosemirror.net/
MIT License
7.53k stars 334 forks source link

Bug: Duplication of First Character When Switching to Bold/Italic with IME Enabled #1450

Closed Stardusten closed 4 months ago

Stardusten commented 4 months ago

Platform Arch Linux, fcitx5 IME, Chrome 122.0.6261.128

Screenshots When I enable IME (Input Method Editor) and switch to bold/italic font, the first character always duplicates. This issue is demonstrated in the following videos:

Screencast from 2024-03-18 09-45-04.webm

Everything seems fine on Firefox.

marijnh commented 4 months ago

Not sure whether to blame Chrome or the IME software, but when this happened, the reported cursor position wasn't actually adjacent to the inserted text, which threw off ProseMirror's composition handling. Attached patch should help.