"foundnode" is not showing value of custom attrs #6259
-
|
As I'm requesting to parse custom "id" which I added to attrs, command will show me text allign without any problems, but "id" value shows as "null" (i've checked in db that it is has a value). What seem to be a problem here? Is there a way to do it? |
Beta Was this translation helpful? Give feedback.
Answered by
arnaugomez
Apr 11, 2025
Replies: 1 comment 14 replies
-
|
Hi @dsipetcher Could you provide a CodeSandbox or code snippet so we can reproduce the bug? The more details you provide, the more likely we can provide a helpful answer. |
Beta Was this translation helpful? Give feedback.
14 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @dsipetcher,
Thanks for reaching out and providing the detailed code snippets!
It sounds like you're correctly adding an
idto your node data before it potentially gets to Tiptap (or intending for it to be there), but when you try to access it later vianode.attrs.idafter inspecting the editor state (state.doc.descendants), it comes back asnull. You also noted that standard attributes liketextAlignwork as expected.The most probable reason for this behavior is that Tiptap's schema isn't aware of your custom
idattribute.Tiptap relies fundamentally on its schema, which is built from all the extensions you provide (
Paragraph,Heading,Bold, yourCustomParagraph, etc.). Each extensi…