Skip to content

Bug: Nested composers not running $config transforms for nodes inherited from parent #7756

@takuyakanbr

Description

@takuyakanbr

Nested composers seem to not be running node transforms defined via the new $config API, for nodes that are inherited from the parent editor. A specific manifestation of this issue is that list item indices are not being auto-incremented as the user types out a list (see screenshot below).

Image

I'm guessing this could be because we're not pulling in the transforms defined via the $config API in
LexicalNestedComposer::getTransformSetFromKlass.

More context about our setup

We have a custom "collapsible" node that uses LexicalNestedComposer in its implementation. The nested composer inherits nodes from the parent editor as no nodes are specified when the child editor is created. The code fragment below should help to illustrate the setup.

export class CollapsibleNode extends DecoratorNode<React.Node> {
  __content: LexicalEditor;

  constructor(
    content?: LexicalEditor,
    key?: NodeKey,
  ) {
    super(key);
    if (content) {
      this.__content = content;
    } else {
      this.__content = createEditor();
    }
  }

  decorate(): React.MixedElement {
    return (
      <LexicalNestedComposer
        initialEditor={this.__content}
        initialTheme={[...]}>
        <RichTextPlugin [...] />
        [...]
      </LexicalNestedComposer>
    );
  }

  [...]
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions