lexical
lexical copied to clipboard
Bug: Pasting into an empty quote node converts it to a paragraph
Lexical version: v0.12.2
Steps To Reproduce
- Open https://playground.lexical.dev
- Copy some text from elsewhere in the playground editor contents
- Start a new quote using either
>or the menu - Paste your copied text
The current behavior
The quote formatting is lost and replaced with a plain paragraph.
https://github.com/facebook/lexical/assets/415/7d8b7703-a7c6-49f5-bb3a-52303d272f99
The expected behavior
The quote formatting is kept when pasting.
This issue is not reproducible in 0.16.0
https://github.com/facebook/lexical/assets/8845364/8e666eab-3495-4d69-953b-62cfe0a0854d
Confirmed, this looks to be fixed 🙏
Closing for now, if we detect other issues after upgrading I'll re-open/open a new issue.
On further testing this only appears to have been fixed when a copy results in the clipboard only containing text nodes. If a whole paragraph node is copied then a paste into a quote still clears the quote which feels unexpected.
I've worked around that in our editor here https://github.com/TryGhost/Koenig/pull/1297/files but I'm re-opening the issue as it still feels like a core concern. However, please feel free to close if this expected behaviour crosses the core/userspace concern boundary.