liveblocks / liveblocks

Liveblocks is the platform for adding collaborative editing, comments, and notifications into your application.
https://liveblocks.io
Apache License 2.0
3.51k stars 281 forks source link

Bug: Comment Splits into Two When Typing in Vietnamese and Pressing Enter #1717

Closed lamtuanamc closed 3 months ago

lamtuanamc commented 4 months ago

Describe the bug

When using the comment feature in Liveblocks and typing in Vietnamese, if there are still underlined words (indicating that they are in the process of being composed), pressing Enter splits the comment into two. However, clicking the send button does not cause this issue.

To Reproduce

  1. Open the comment feature in Liveblocks.
  2. Start typing a comment in Vietnamese.
  3. Ensure that there are still underlined words (indicating that the words are being composed).
  4. Press Enter to submit the comment.

Expected behavior

The comment should be posted as a single comment regardless of whether the Enter key or the send button is used.

Actual Behavior: When pressing Enter, the comment is split into two separate comments. When clicking the send button, the comment is posted as a single comment as expected.

Illustrations

https://github.com/liveblocks/liveblocks/assets/37234239/51ac76ab-c52e-4902-8697-3884b9415377

marcbouchenoire commented 4 months ago

Hi @lamtuanamc, thanks for the detailed report!

We'll investigate, and in the meantime could you try Entering on https://www.slatejs.org/examples/richtext and tell us if there are any unexpected behaviors? This is the text editor used in the Comments composer.