Skip to content

Commit

Permalink
Wrap the DocNodeView in a ChildDescriptorContext.
Browse files Browse the repository at this point in the history
When rendering nested ProseMirror editors, e.g.
when taking control over an atom node's content,
the nested DocNodeView would register itself as
the child of the atom node in the view descriptor
tree. This could cause subtle issues when, e.g.,
ProseMirror attempts to determine whether the
content is ltr or rtl, because it would treat the
nested editor as the contentDOM of the atom, even
if it was rendered in a portal into a non-
contiguous part of the page. Presumably other
issues could also arise from the fact that
ProseMirror thought this node had a contentDOM
when it actually does not.

This PR resolves this by simply providing a top-
level ChildDescriptorContext, so that nested
editors never accidentally cross the boundary up
into their parents' view descriptor tree.
  • Loading branch information
smoores-dev committed Mar 7, 2024
1 parent 7c45b60 commit cf19644
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
Loading

0 comments on commit cf19644

Please sign in to comment.