[lexical-link] Feature: Enable Selective Removal Within Linked Text#7944
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
etrepum
left a comment
There was a problem hiding this comment.
This seems fine, it's nice that it doesn't break any existing test expectations and the new behavior has new ones.
Is there some specific editor(s) that this change is inspired by? It seems that most other editors we have looked at don't really have this behavior.
|
@etrepum After switching to Lexical for some clients, they noticed an issue with unlinking portions of text. It became cumbersome when they accidentally linked spaces at the end of a selection because when they tried to unlink just the space, it would remove the link from the entire text instead. What should have been a one-step process turned into two. |
@etrepum thanks for the quick merge. you can see this behavior in ProseMirror, Quill, CKEditor, and the (3rd party, i know) DraftJS link/anchor plugin. the DraftJs plugin being the reason our clients are used to having that functionality |
Description
This PR allows for specific highlighted text to be be unlinked. This fixes when attempting to remove part of a linked word, lexical will remove the link from the entire text rather than just the selected portion. This forces the user to reapply the link to the intended text.
Closes #7943
Test plan
Before
Trying to unlink a portion of the text would cause the entire text to become unlinked.
After
When selecting a portion of the text to unlink, only that portion will become unlinked.