[Bug]: Range Error thrown if you try to use bold/italic/strike/code with hotkeys and combine it with a mention #6109
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
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 wrongfrom
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
The text was updated successfully, but these errors were encountered: