Repository navigation
Conversation
Addresses the Enter-then-Backspace case in handlewithcarecollective#11.
|
Thanks @iankirsch! I'm finally going to have some time to sink back into this library starting tomorrow, so I'll take a look at this then. I am playing around with the idea of removing the insertion anchors entirely. |
|
No worries, thanks for your work on this library, it's been really useful for us! Happy to close this if the anchor rework ends up covering the same case! |
|
Let's leave it open for now and see where the refactor gets us 😅 . Do you mind if I ask what you're using the library for in the mean time? It's awesome that folks are making use of it! |
|
Not at all! We're building Storytide, which is sort of an IDE for social media content creation: teams run the whole thing in one place, from strategy and planning on a kanban board and calendar, to writing and live collaborative review, as well as scheduled publishing. The library powers the review side, giving us Google Docs-style suggestion tracking in our TipTap + Yjs editor so collaborators can propose tracked edits that the content owner accepts or rejects. |
|
Very cool! Thanks for sharing 😁 |
When suggesting, it is currently impossible to fully remove a paragraph break that was just added (the Enter-then-Backspace case in #11).
The break is held by invisible insertion anchors, so Backspace deletes an anchor instead of the break, and the break ends up marked as a deletion rather than removed.
This pull request adds a
removeInsertedBreakcommand on Backspace/Delete that removes the break in one keystroke (paragraphs and list items), and updatessuggestReplaceStepto join the blocks and drop the anchors when a step only deletes an inserted boundary. Real boundaries are still tracked as deletions. This brings removing added paragraph breaks in line with how removing regular inserted text already works, and with expected behaviour from Google Docs and similar editors.This pull request only covers the first case in #11. The end-of-list Delete-then-Backspace case is a separate problem in
suggestReplaceAroundStep, so I've left it for now.