-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Request: more control over child divs created by node views #1527
Comments
Does that help?
https://www.tiptap.dev/guide/node-views/react#adding-a-content-editable |
Hi @hanspagel , thanks for the suggestion but no it doesn't. When you set |
This is an issue for me as well. I'm trying to add an editable caption to an image and need to set up
Unfortunately, this doesn't get passed down to the Would be great to either remove the inner |
Unfortunately we can’t remove any of these divs. It’s because node views (dom and contentDOM) have to be synchronous. React can only render asynchronous. In Vue.js we don’t have to render these wrapper nodes. |
For me the problem is that I am trying to use a component from an external library, but this component accepts only I am passing
Is there anything I can do to just pass a |
Fixed by #2213 |
@philippkuehn I'm sorry, but I don't understand how #2213 fixes the problem with the extra inner div of NodeViewContent? |
This issue is still actual, cannot add extra table cell to table row without breaking the table structure with extra div. Please reopen |
The problem I am facing
When working with Node Views in React, Tiptap creates two wrapping divs around both the node view itself and the content. Visually:
This is fine for many blocks but can lead to non-semantic HTML and messed up rendering. In my case, I created a TableRow node view and so I end up with DIVs between the TR and TD tags.
The solution I would like
Ideally, my content could be rendered without any intermediate divs. I don't know enough about Prosemirror to see why these are needed in the first place. Alternatively, I wish there was a single wrapping div and I could control the tag used for it.
Alternatives I have considered
For now, I'm getting around this by applying the
display: contents
CSS property to the intermediate divs to prevent them from actually rendering. This is messy but seems to work alright. It makes me wonder if the divs are actually providing any value, since they aren't being displayed.The text was updated successfully, but these errors were encountered: