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: Character insertion position/order sometimes wrong #374

Open
PatrickNausha opened this issue Apr 29, 2024 · 2 comments
Open

Bug: Character insertion position/order sometimes wrong #374

PatrickNausha opened this issue Apr 29, 2024 · 2 comments

Comments

@PatrickNausha
Copy link

quill-mention-reversed-characters

If you use Alt + Left/Right Arrow keys on MacOS (and presumably Ctrl + Left/Right on Windows) to jump between whole words in the editor, you run into problems.

Repro steps:

  1. Go to https://quill-mention.com/
  2. Enter arbitrary text into one of the demo inputs
  3. Enter a mention
  4. Enter more arbitrary text
  5. Click text a few words prior to the mention to place the editor caret there
  6. Press Alt + Right repeatedly until the caret arrives at the end of the mention
  7. Press the H key
  8. Press the I key

Expected behavior: The text "hi" is inserted.
Actual behavior: "ih" appears.

There's also a more obscure repro I ran into with my custom styles:

  1. Override these styles and set the margin to margin: 0; (to have no margin on mention elements).
  2. Enter text ending with a mention, e.g. "Hi there, @Mickey Dooley"
  3. Click to place the caret at the start of the string.
  4. Click to place the caret at the end of the string.
  5. Type "hi" and see it appear as "ih"
@PatrickNausha
Copy link
Author

I'm not sure if this is at all related, but it seems Quill has historically had problems with caret placement with Embed blots (quill-mention uses embed blots). For example,

@manacy-keyvalue
Copy link

I'm facing the same issue in my nextjs app router based project. Please suggest how to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants