[Documentation]: onNodeChange Can you provide more examples for this please? #5724
Labels
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Type: Documentation
The issue or pullrequest is related to documentation
What’s the URL to the page you’re sending feedback for?
https://tiptap.dev/docs/editor/extensions/functionality/drag-handle-react
What part of the documentation needs improvement?
PREFACE:
I am trying to implement Tiptap in react/Next and ideally I would like to have the TipTap template imported into my project and just pass it a unique ID and JSON for content, but it doesn't seem that is ready yet.
Currently, I have most components implemented, but I cannot remove or delete added components. I see that in the tiptap templates demo, that you can. From what I have read of the documentation , I can see that there is something called a onNodeChange. Maybe that is something which I can use to get a unique ID or the starting and ending positions of the node to call delete.
What is helpful about that part?
It is in general helpful, but needs more examples I think.
What is hard to understand, missing or misleading?
When I try to implement onNodeChange , it just closes the (openslash) / menu or doesn't do anything at all.
I tried to use "pluginKey " but it crashed for some odd reason IIRC. TDLR I am just trying to recreate the template that is in the demo with react/next and need a way to delete components.
Anything to add? (optional)
Can the TipTap template just be imported into react ? Or is there a way to have components deleted when I call them? I also don't see a unique id for each created, but perhaps I haven't looked hard enough.
I was thinking that maybe I could just wrap a div around each component with a ref to a unique id and then just tie the delete button to it.
I like this project enough, that if I could get this working well that it would be worth purchasing a license for it. Unfortunately , it's not in that position yet.
The text was updated successfully, but these errors were encountered: