-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lexical-react] Fix multiple node selection deletion #6538
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Request for comment: The $onDelete method is super repetitive and identical for the exception of the 'isNodeOfType' check. Since most of these are in the playground, could do an util function, but an alternative solution is to modify this on the 'rich-text' plugin level deleteHandler and remove all of the $onDelete methods and overrides. Thoughts?
Agree! IMO I'd make it into the rich/plaintext plugins as a command to mimic what we already do with RangeSelection.
REMOVE_NODE_COMMAND
would be the equivalent of DELETE_CHARACTER_COMMAND
. We implement REMOVE_NODE_COMMAND
either in the selection module or rich/plain plugin and allow for plugins to override it if necessary.
Unfortunately, this non backward compatible change can accidentally break some products so we might need a version bump at the very least or rethink how we ship this. FWIW, when selected nodes > 1 this is always the desired behavior since you're not expected to interact with the node without resetting the selection.
OK, will merge this as is then and think on the REMOVE_NODE_COMMAND intro |
Selecting multiple nodes using Cmd + Shift + Click, which results in a NodeSelection with multiple nodes currently doesn't delete all of the selected nodes.
Before:
before_node_selection_fix.mov
After:
after_node_selection_fix.mov
Request for comment: The $onDelete method is super repetitive and identical for the exception of the 'isNodeOfType' check. Since most of these are in the playground, could do an util function, but an alternative solution is to modify this on the 'rich-text' plugin level deleteHandler and remove all of the $onDelete methods and overrides. Thoughts?
@zurfyx @etrepum @potatowagon