Conversation
The node view marked every container block. The React adapter marked its containers a second time, on the author's own element. Two elements then carried the same block id and the same block type. Move the marking into the vanilla render path, which React does not use. Each container now has one element with its identity. Also add a guard to the multi-column drop handler, and point four comments at their counterparts.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/diagram-block
@blocknote/mantine
@blocknote/math-block
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
@blocknote/xl-typst-exporter
commit: |
|
(note; didn't check the specific solution, there might be cleaner ways to structure it, but I do think the problem should be addressed)
What this changes
createSpec.tsmarks the DOM of a container block. The mark puts the block type, the block id and the block props on the container's root element. It also putsdata-children-ofon the element that holds the child blocks.Before this change, the node view marked every container block. A React container also has an adapter. That adapter marks the author's own element a second time. Two elements then had the same block id and the same block type.
The new function
markContainerStructuredoes the mark. Only the vanilla render path calls it. React does not use that path. A React container therefore keeps only the mark from its adapter.What this corrects
The example
custom-schema/container-blockshows the effect. These are the counts for the panel block:data-children-ofA regular block still has two elements with the block id. These are
blockOuterandblockContainer. The block selector ignoresblockOuter, and one element stays.This fix is also mentioned in the comment on
BlockPopoverin the original PR (and the suggested fix builds on this PR)The other files
Three files get new comments only:
containerAttributes.tsnames the counterpart ofapplyContainerAttributes.internal.tspoints fromwrapInBlockStructureto the container path.useNodeViewBlock.tsexplains the condition on thebnBlockgroup.One file gets a guard.
multiColumnHandleDropPlugin.tsthrows an error if the target column is not a child of its column list. The code reads both from the same document, so an absent column shows a fault. Without the guard, the code puts the new column at the wrong index.Tests
packages/core: 932 tests pass.packages/xl-multi-column: 103 tests pass.vp lint --type-aware: no problems.🤖 Generated with Claude Code