Skip to content

Bug: Selecting text by triple clicking also selects the following top level nodes, up to and including the next text node. #2660

@AaronGazzola

Description

@AaronGazzola

Triple clicking a text node in the lexical playground selects the parent node and the following top level nodes up to and including the next text node.

The following image shows the resulting editor state after triple clicking the first paragraph:
Editor state after triple-clicking a paragraph node that is followed by a decorator node and a paragraph node

This causes a breaking bug where the page becomes unresponsive if the block format drop down menu is used to format content that was selected this way, if the content contains a decorator node.

The following image is the unresponsive playground after triple-clicking the text above a YouTube node and then using the dropdown block format menu to format the content as heading 3:
Unresponsive playground

Lexical version: 0.3.7

Steps To Reproduce

  1. Insert a top level decorator node into the lexical playground, such as a YouTube node
  2. Create paragraph nodes with text content above and below the top level decorator node
  3. Select the text in the first paragraph node by triple clicking (the tree view plugin should show that the bottom paragraph node is also selected, while the text in the editor is not highlighted)
  4. Use the dropdown block format menu to change the format to any of the options, eg. Heading 1

Link to code example: https://playground.lexical.dev/

The current behavior

Selecting text by triple clicking also selects the following top level nodes, up to and including the next text node.

The expected behavior

When text is selected by triple clicking, only the clicked node should be selected

Metadata

Metadata

Labels

all-platforms-bugcoreReconciler, DOM, Selection, Node, Events, Composition

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