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]: Range Error thrown if you try to use bold/italic/strike/code with hotkeys and combine it with a mention #6109

Open
1 task done
bagratinho opened this issue Feb 17, 2025 · 0 comments
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

@bagratinho
Copy link

bagratinho commented Feb 17, 2025

Affected Packages

core, extensions-mention, extensions-code

Version(s)

2.11.5

Bug Description

When you use a backtick to write inline code and then you write a mention inside you get a Range Error on closing backtick.
I have put together minima example combining examples from tiptap docs to showcase the issue.

MentionList-jsx---nodebox---CodeSandbox.webm

Also attaching a video.

I have tried to debug, and seems that issue is in InputRule class, and run method receives wrong from parameter from config, hence the wrong calculation of range object.
From is always comes N amount less then correct from should be, where N is equal to the length of the mention not including @ sign.

Browser Used

Chrome

Code Example URL

https://codesandbox.io/p/sandbox/xt6f8x?file=%2Fsrc%2Fasd%2Fsuggestion.js%3A9%2C9

Expected Behavior

It should correctly wrap the code and mention element respective Mark, and no error should be thrown

Additional Context (Optional)

No response

Dependency Updates

  • Yes, I've updated all my dependencies.
@bagratinho bagratinho 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 Feb 17, 2025
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

1 participant