Skip to content

Bug: Inserting a DecoratorNode into the block cursor inside an ElementNode throws an exception #8713

Description

@levensta

Lexical version: 0.45.0+dev

Steps To Reproduce

  1. Insert the decorator inside the simple element (not shadow root). For example, a HorizontalRuleNode inside a CollapsibleTitle
  2. Copy HorizontalRuleNode (click and press Ctrl + C)
  3. Press the ArrowRight or ArrowDown to display the block cursor
  4. Paste the copied node

Link to code example: https://playground.lexical.dev/#doc=H4sIAAAAAAAAE82SQUvEQAyF_8s7j0sr61bnB3he6FE8jJ24HYiTkqaLdel_l1kV3AUF0YOn8AjvJfnIARSTibYWjOAPUBErtesTR6UMf_edsHkgePSi6UWyBdaJCQ570jFJhq-Xe4eYlDo76jwxOzyKPgWDBxxSjpQNvnIfaZ0wh2FMD0wXluw80H290M9nDUHDTsPQn8xwMHq223dn9SZbm7lY8MuTOslW2n9IqUSGlEnPrpChYDGd6IzavwV1_L8TMosDh9HasKcIXzfXdXO5uVlX9aZxGGXSrvi2HOadypTjZzeq1fpqVWF5BQgpnvboAgAA

The current behavior

An exception is shown in the console. The copied node is not inserted into the same element as the block cursor

block-cursor-in-element.mov

The expected behavior

The copied node is inserted into the block cursor

Impact of fix

Follow-up #8707

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions