-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ignoreMutation and atom nodes #1448
Comments
as far as I know |
From prosemirror docs:
Though not super explicit, I'm fairly sure you can define a nodeview with content (which would make it not a leaf), but define it as atom (to indicate PM should not handle editing) |
This confirms it's possible (@philippkuehn ): |
Hmm you are right. But I’m still not sure about a use case for this configuration? 🤔 |
@philippkuehn this is a relevant example: https://prosemirror.net/examples/codemirror/ Let's say you want to embed an editor (could also be a textarea) inside tiptap. You want to store the editor contents in the tiptap document, but want to handle interactions yourself (or in the above example, by codemirror. In that case the element should be an atom (it should be opaque to tiptap / prosemirror), but not a leaf (it should be capable of containing text contents) |
Ah makes totally sense! Fixed it. |
Cool. Just to be clear; I based my feedback on your original comment in the code, which indicated it seemed erroneous. I don't know whether there are any real-life bugs that are prevented by this, for this I don't know enough about how Do you know what ignoreMutation actually prevents from happening on the PM side when it returns true? |
|
I'm not (yet) an expert on prosemirror and how atom / leaf nodes work, but I noticed the following line in TipTap:
https://github.com/ueberdosis/tiptap/blob/main/packages/core/src/NodeView.ts#L186
Based on the comments, it seems unexpected for me that you only check for
isLeaf
, and not whether the node is an atom.The text was updated successfully, but these errors were encountered: