-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Prevent selection deletions at the end of list items from joining lists #5863
Prevent selection deletions at the end of list items from joining lists #5863
Conversation
If starting a selection at the end of a list item, then pressing delete, the selected text wasn't being deleted, but instead the following list item was joined to the end. Now the selected text will be deleted. Joining will only occur if the selection spans multiple nodes or it's collapsed.
🦋 Changeset detectedLatest commit: 8f7daae The changes in this PR will be included in the next version bump. This PR includes changesets to release 54 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for tiptap-embed ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
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.
Fantastic contribution, thanks @glenn-allen!
…s from joining lists (#5863) If starting a selection at the end of a list item, then pressing delete, the selected text wasn't being deleted, but instead the following list item was joined to the end. Now the selected text will be deleted. Joining will only occur if the selection spans multiple nodes or it's collapsed.
Changes Overview
Previously the text wasn't being deleted, but the following list item was being joined (see the testing videos within Verification Steps)
NOTE: The fix might be better suited to the
isAtEndOfNode
function from@tiptap/core
- however because that's exposed it might result in unintended regressions out in the wild.Implementation Approach
Traced the ListKeymap delete handlers and debugged guard statements that were trying to avoid the
joinItemForward
command.Testing Done
All initial tests passed & performed manual testing of the
http://localhost:3000/preview/Extensions/ListKeymap
demo.Verification Steps
Attempted a deletion of text, starting from the end of a node - then going backwards, before & after the change:
Before
List.keymap.before.mp4
After
List.keymap.after.mp4
Checklist