Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Input field truncates text when reaching max length with CJK IME #5928

Open
1 task done
wt-lin opened this issue Dec 11, 2024 · 3 comments
Open
1 task done
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug

Comments

@wt-lin
Copy link

wt-lin commented Dec 11, 2024

Affected Packages

extension-character-count

Version(s)

2.5.6

Bug Description

Environment

  • Operating System: Windows 11
  • Browser: Microsoft Edge
  • Input Method: Japanese IME
  • Framework: React

Steps to reproduce

  1. Open an input field with a defined maximum character length
  2. Fill the input field to its character limit using English characters or numbers
  3. Move the cursor to the end of the existing text
  4. Activate Japanese Input Method Editor (IME)
  5. Attempt to input hiragana characters (e.g., あああああ) using IME typing, then press "Enter".
  6. Observe that the existing trailing text is unexpectedly replaced instead of being preserved

This issue can be reproduced in the sample
https://tiptap.dev/docs/editor/extensions/functionality/character-count

Browser Used

Edge

Code Example URL

No response

Expected Behavior

  1. When the input field is at maximum length, new IME input should not replace existing text
  2. The input field should prevent additional input or handle the maximum length constraint appropriately

Additional Context (Optional)

  1. The issue also happens in Chinese IME.
  2. Reproduction does not work with copy-paste methods. So please type it.

Dependency Updates

  • Yes, I've updated all my dependencies.
@wt-lin wt-lin added Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug labels Dec 11, 2024
@nperez0111
Copy link
Contributor

If the limit option is provided, it will not allow text that is longer than the limit to be in the editor. If this option is unset, it will not attempt to truncate text https://tiptap.dev/docs/editor/extensions/functionality/character-count#limit

@wt-lin
Copy link
Author

wt-lin commented Dec 12, 2024

Hi @nperez0111,
This issue only happens in Windows. I know the behavior you mentioned, but could you check the video below? The text is replaced by the IME input. This looks odd imo.

Once we press "Enter" to complete the input with CJK IME, the existing text shouldn't be replaced by the new input.

issue.mov

@nperez0111 nperez0111 reopened this Dec 12, 2024
@nperez0111
Copy link
Contributor

Ok I see what you are saying now. Unsure how to resolve it, would take a PR for it. But definitely not a high priority as it is relatively minor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Open Source The issue or pull reuqest is related to the open source packages of Tiptap. Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

2 participants