ueberdosis / tiptap

The headless rich text editor framework for web artisans.
https://tiptap.dev
MIT License
26.6k stars 2.23k forks source link

[Bug]: Japanese IME input issue with multi-line selection in Tiptap editor #5416

Open OmataNanae opened 1 month ago

OmataNanae commented 1 month ago

Affected Packages

core, react

Version(s)

2.4.0

Bug Description

When selecting multiple lines of text in the Tiptap editor and attempting to input Japanese characters using IME, the following issues occur:

  1. Japanese input becomes impossible.
  2. Only the first line of the selected text is deleted, while the second and subsequent lines remain unchanged.

Steps to Reproduce:

  1. Open the Tiptap editor.
  2. Enter two lines of text:
    • First line: Katakana characters (e.g., "テスト")
    • Second line: One Hiragana character (e.g., "あ")
  3. Select both lines of text.
  4. Attempt to input the same Hiragana character as in the second line.
  5. Observe that the first line disappears, but the second line remains unchanged, and further Japanese input is impossible.

Browser Used

Chrome

Code Example URL

https://codesandbox.io/s/tiptap-demo-ed6wqf

Expected Behavior

When selecting multiple lines and inputting Japanese characters, all selected text should be replaced with the new input, and Japanese input should continue to function normally.

Additional Context (Optional)

Dependency Updates

nperez0111 commented 1 month ago

Hm, I was not able to reproduce in our demos. But I'm copying and pasting rather than inputting directly (I would not know how to input Japanese characters otherwise). It would be helpful to know if you are having this issue on this demo for example (just because you seem to be using an older version of tiptap) If you are still having issues, I would like to narrow it down to either Tiptap or prosemirror (our base rich text editing library) so could you also try it on this example page?

Thank you for your help with this

honoka-anraku commented 3 weeks ago

Thank you for your response.

I work at the same company as the original questioner, and we are developing the same product. The original questioner has since left the company, so I am responding on their behalf.

I was able to reproduce the issue using ProseMirror directly. To clarify, I tested the issue on both the Tiptap demo and the ProseMirror example page. The problem persists in both cases, which suggests that the issue might be rooted in ProseMirror itself rather than just Tiptap.

Please let me know if there's any additional information I can provide or any further tests you'd like me to run.

nperez0111 commented 3 weeks ago

That is helpful to know, I would have to direct you to Prosemirror's issue tracker instead since it seems to be based on them.

honoka-anraku commented 3 weeks ago

Thank you for your guidance.

I will go ahead and report this issue to the ProseMirror issue tracker. I appreciate your help in narrowing down the cause.