[Bug]: Undo inputRule misses last typed character #6232
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, inputRule
Version(s)
2.11.7
Bug Description
When using markdown notation for creating a mark and then executing "undo", I expect to see the full typed text without the markup. Instead, what happens, is that the text including the stars are removed.
Eg:
Typing a "*" makes the text bold (correct), typing Ctrl+Z I expect to see the text
**I'm not bold**
, but instead I see**I'm not bold*
(see that the last star missing).I dug into the code, and discovered that the an inputRule applies the mark before the text is inserted. I suspect that this causes this issue that the last character is missing.
Browser Used
Firefox
Code Example URL
https://codesandbox.io/s/tiptap-js-fv1lyo
Expected Behavior
See the text
**I'm not bold**
, but instead I see**I'm not bold*
(see that the last star missing).Additional Context (Optional)
No response
Dependency Updates
The text was updated successfully, but these errors were encountered: