Unnest list item with children using Backspace at start of line #6297
baranka144
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Problem
In ProseMirror (and consequently Tiptap), pressing
Backspace
at the very beginning of a list item that has nested children does not unnest the item as one might intuitively expect. Instead, it exhibits the following behavior:Backspace
selects the content/line directly above the list item.Backspace
again deletes that selected content.Example:
Some preceding text
List Item 1
Pressing
Backspace
with the cursor at the start of "List Item 1" will select "Some preceding text". PressingBackspace
again will delete "Some preceding text".This behavior is inconsistent with how
Backspace
works at the start of a list item without children (where it typically unnests the item).Desired Behavior
We propose that pressing
Backspace
at the very beginning of a list item that has nested children should behave identically to the existingShift + Tab
keyboard shortcut for that same item.Specifically, it should unnest the current list item, bringing it and all its nested children up one level in the list hierarchy.
Using the previous example:
Some preceding text
Pressing
Backspace
(orShift + Tab
) should result in:Some preceding text
List Item 1
I understand that the current
Backspace
behavior likely originates from ProseMirror's default keymap handling. However, I believe it should be possible to adjust this behavior specifically within Tiptap to achieve the desired unnesting action described above.Thank you!
Use Case
Tiptap already provides the
Shift + Tab
/Tab
combinations for managing list indentation, andShift + Tab
correctly unnests items with children. Aligning theBackspace
behavior at the start of such items with theShift + Tab
behavior would:Backspace
at the start of a line/block to modify the indentation or structure of that block.Backspace
behavior consistent regardless of whether a list item has children or not, unifying the unnesting action.Backspace
) for a frequent list editing action.Type
New extension
Beta Was this translation helpful? Give feedback.
All reactions