facebook / facebook/lexical

Bug: After pasting a link, I focused on the URL input and pressed Ctrl+Z (undo). The latest node inserted was the link, but the other part of the text is being undone, and the undo command isn't reflected in the tree view.

Open
#6,714 3 comments 3 reactions 0 assignees View on GitHub
hyperlinks
Dominant language
TypeScript
Stars
23.9k
Forks
2.2k
Avg merge
1d 14h
Merged PRs (30d)
55

Description

I typed some text and pasted a link. After clicking on the URL input and pressing `Ctrl+Z` (Undo), the other text was undone instead of undoing the link. However, this action was not reflected in the tree view, leaving me unsure if the undo command was executed.

Upon pressing `Ctrl+Z` again, the focus shifted back to the URL input, and the previously removed text was restored, indicating that the undo command was executed.

**After performing the undo action twice, I returned to the initial state.**

https://github.com/user-attachments/assets/07cee566-add2-4b22-a3f0-b162b45d8b0b

Lexical version: 0.18.0

## Steps To Reproduce

1. Enter some text in the editor.
2. Paste the link.
3. Click on the `Edit` icon in the Link Popup.
4. Press Ctrl + Z.
5. Again Press Ctrl + Z.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.