lexical icon indicating copy to clipboard operation
lexical copied to clipboard

Bug: Additional paragraph inserted when pressing "Enter" within AutoLinkNode

Open polyrainbow opened this issue 1 year ago • 0 comments

When pressing "Enter" and the cursor is within an AutoLinkNode, the link is split into two paragraphs, but there is also an empty paragraph is inserted in between. This is also reproducible in the Playground.

Lexical version: 0.14.3

Steps To Reproduce

  1. Visit playground and delete demo text
  2. Type "http://example.com"
  3. Press left arrow key to move cursor one character to the left
  4. Press "Enter"

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

https://github.com/facebook/lexical/assets/5648131/04f1b334-e41d-4f46-94d2-2e01cbbdd52a

The current behavior

There are 3 paragraphs, because an additional empty ParagraphBlock is inserted.

The expected behavior

There should be 2 paragraphs, one with text content http://example.co, and one with text content m.

polyrainbow avatar Apr 13 '24 10:04 polyrainbow