Open tobewisebeforeiamold opened 10 months ago
I'm facing this same problem. It's a bug in this part of the code:
In my case, I'm not pasting any complex node: I'm literally pasting a long text file that contains no format at all: it's coming with a .txt
file with a lot of lines (which become paragraphs). In my case, tr.doc.content.size
is 22730, while newSize
is being calculated as 21516 (I'm working with a limit of 10000).
After deleting the amount of characters that are supposed to be over (11516), the remaining size is 10664.
To be honest, the behavior is pretty unintuitive.
i have the same problem(when i use insertContent with many nodes at once);It would be best if it can be intercepted automatically
Which packages did you experience the bug in?
CharacterCount, react
What Tiptap version are you using?
2.1.15
What’s the bug you are facing?
When using
CharacterCount.configure({ limit: 240 })
and attempting to paste in more than 240 characters that is not unformatted text from the clipboard, the input remains empty.I can reproduce this in the "Usage" example on at the bottom of https://tiptap.dev/docs/editor/api/extensions/character-count#usage.
This page (https://tiptap.dev/blog/release-notes/new-character-count-extension) seems to indicate that this copy/paste behavior is a bug.
To Reproduce
What browser are you using?
Firefox
Code example
https://tiptap.dev/docs/editor/api/extensions/character-count#usage
What did you expect to happen?
If I configure CharacterCount to use a limit of 240 characters, and I paste in 250 characters, even if it's formatted, I would expect to see 240 of those 250 characters
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?