lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: With CJK composition IME, deleted text reappears on new input

Open joint-sangjune-bae opened this issue 1 year ago • 3 comments

A critical bug occurs in the Lexical Playground on the Safari browser (iOS 16 Pro simulator) where previously deleted text reappears when new text is typed. After deleting characters and then typing in the now-empty space, the old characters are incorrectly inserted along with the new input.

https://github.com/user-attachments/assets/b882f225-18a0-43c2-a715-dece4e1757ef

This issue appears to be environment-specific, as it is not reproducible on another MacBook with an identical simulator setup.

https://github.com/user-attachments/assets/a6956ac8-6cb6-43a8-a60a-1a445e008e19

A key difference in Backspace behavior was also observed between the two systems:

On the faulty system (where the main bug occurs): Backspace deletes text character-by-character.

On the normal system (for comparison): Backspace deletes text by its composition unit (e.g., one part of a Korean character at a time).

Additionally, in both environments, after clearing all text with Ctrl+Backspace, pressing Backspace in the empty editor causes the deleted text to be re-inserted and then deleted.

https://github.com/user-attachments/assets/39baf96b-25b6-42cf-a378-f4572961164f

Videos are attached to demonstrate the main bug, as well as the different Backspace behaviors.

Lexical version: v0.33.1 // palyground: ( v0.34.0+dev.esm)

joint-sangjune-bae avatar Aug 28 '25 13:08 joint-sangjune-bae

The difference in behavior could depend on the exact version of iOS and Simulator that you are using. I don't think anyone on the team will have any chance at helping with this unless you can provide reliable reproduction instructions. Is it reproducible on an actual device, or only in the simulator on this particular computer?

etrepum avatar Aug 29 '25 17:08 etrepum

The difference in behavior could depend on the exact version of iOS and Simulator that you are using. I don't think anyone on the team will have any chance at helping with this unless you can provide reliable reproduction instructions. Is it reproducible on an actual device, or only in the simulator on this particular computer?

Here is some of the information reported by our actual users. The issue is currently reproducible only in the iOS environment. We have reports from two users:

  • One is using an iPhone 11 Pro with iOS version 18.6.1 or 18.6.2.
  • The other user is reportedly on a newer device

joint-sangjune-bae avatar Sep 01 '25 01:09 joint-sangjune-bae

Tried to reproduce on current main (v0.46.0) with macOS Safari + Korean IME — typing, deleting with Backspace, then typing again works normally without any reappearance of deleted text. Backspace deletes by composition unit (jamo-by-jamo) as expected.

This lines up with the environment-dependent behavior described above. The difference in Backspace behavior (character-by-character vs composition-unit) suggests the iOS keyboard on certain device/version combinations handles composition commit timing differently.

mayrang avatar Jun 27 '26 07:06 mayrang