lexical
lexical copied to clipboard
Bug: Line break inside link node appends text to the end of the current paragraph
When inserting a line break by pressing Enter
while the cursor is inside a link the part of the link that is at the end will go to the end of the current paragraph and not to the start of the next line. Follow the steps to reproduce for an example or see the attached video.
Lexical version: 0.17.1
Steps To Reproduce
- Have the text
Some text. https://www.google.com Some other text.
in the editor https://playground.lexical.dev/ - Set the cursor inside the link, for example between
c
ando
:https://www.google.c|om
- Press
ENTER
https://github.com/user-attachments/assets/45573cee-8dbf-46f3-9442-9c631b9871f6
Link to code example:
The current behavior
After following the steps to reproduce we have 3 paragraphs with the following content:
Some text. https://www.google.c
Some other text.
om
The expected behavior
It was expected to have only 2 paragraphs with the content:
Some text. https://www.google.c
om Some other text.
Impact of fix
- Low severity
- Any user that uses link nodes may be affected