Skip to content

Commit

Permalink
Wrap the DocNodeView in a ChildDescriptorContext. (#116)
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 change 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 authored Mar 7, 2024
1 parent c6d606e commit 964fc45
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 20 deletions.
Loading

0 comments on commit 964fc45

Please sign in to comment.