Skip to content

Bug: Not all selected nodes are removed if a shadow root element is set at the end #8745

Description

@levensta

Lexical version: 0.45

Steps To Reproduce

  1. Insert collapsible container at the end of content
  2. Select all (double press Ctrl + A)
  3. Press Backspace

Link to code example

The current behavior

There are two empty paragraphs left in the document

delete.all.content.mov

The expected behavior

The document should have all content removed and only one empty paragraph left.ё

Impact of fix

Something similar happens if Columns Layout, Review, or Card is set at the end, and it seems to generally affect any shadow root elements. If the user wants to delete all content based on the selection, it's important to ensure consistent behavior and delete nodes regardless of their type

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