-
-
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
NodeViewContent generates an unnecessary div #2675
Comments
Duplicate of #1527 |
@philippkuehn, if I understand correctly, there is no way to get rid of the internal div element?
<table as="table" data-node-view-content="" style="white-space: pre-wrap;">
<div style="white-space: inherit;"> // <-- This ugly wrapper
/* content */
</div>
</table> |
@philippkuehn I don't think this should be closed? #2213 doesn't seem to fix the unnecessary div problem. This causes a number of issues. Let's say I want to add some controls around a table. I could extend the Table plugin and add Inside of the component used I'd render some control handles and This in turn breaks the structure of the table and most of the commands from the Table extension. |
I'm running into too. Any chance this will get merged soon? |
Beyond tables, this also creates issues when you want to use a CSS grid layout on the children. You develop an extension and add some controls that enable you to manage the grid layout of your component. You apply your grid class to the NodeViewContent, Then, an inner div is added, and instead of the grid classes applying to the children, they are applied to the inner div breaking the layout.
|
@levi-putna I have a similar problem, did you find a way to fix this? |
What’s the bug you are facing?
I'm using React and working on a custom extension for tables and encountered that the NodeViewContent component always creates a nested div element.
↓
How can we reproduce the bug on our side?
NodeViewContent
to render child contentCan you provide a CodeSandbox?
No response
What did you expect to happen?
I would like to avoid unnecessary elements in the DOM.
Anything to add? (optional)
No response
Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: