How to enable paste events? #4118
Replies: 3 comments
-
did you find anything? documentation isn't really helpful on paste rules |
Beta Was this translation helpful? Give feedback.
-
if you're just trying to disable paste, you can use the handlePaste function. unfortunately the return functionality of this function is not documented anywhere, but if you so you need to make sure at the end of your handlePaste, after you've changed the content to your liking, you I have not figured out how to use the |
Beta Was this translation helpful? Give feedback.
-
If you want to handle the pasteEvent,
|
Beta Was this translation helpful? Give feedback.
-
I'm using tiptap on a vue3 quasar. and Here's the problem I'm facing
Whenever I paste data, it's not getting newlines. It's all showing up as a single line.
Moreover, for table tags, it only turns into SPAN tags.
=> I suspect this is caused by tiptap not detecting the table tag - I tried adding all the table extensions and still had the same situation.
Here's what I tried
I've registered this function with the paste event of editor-content like this
This will add the new content in addition to what is already pasted.
So I found a way to disable paste through this article, but the handlePaste function didn't work.
Here's how I used it
and I tried paste-rules, but not work
I tried like this
This extension felt like it only ran once when the editor was rendered.
I also tried using parseOptions, but that didn't work either.
I don't know what else to try, is the only answer to touch ProseMirror's API directly?
If you need to touch it, I'd be grateful if you could tell me how to approach it in tiptap.
I'm having a hard time with this. Thanks
Beta Was this translation helpful? Give feedback.
All reactions