Tab to indent list elements

This seems like a FAQ, but I haven’t been able to find a similar question.

How do I have the tab and shift-tab keys work to indent and unindent list elements? Currently using the tab key in the demo application (http://prosemirror.net/demo/basic.html) causes focus to move to the next element in the browser.

You use a keymap that binds them to the sinkListItem and liftListItem commands.

1 Like

It looks like sinkListItem only works if there is already an indented list underneath the current list item. If that’s the intended behaviour, is there a command to indent/unindent regardless of the surrounding elements or should I try putting something together to do that?

Sounds like you want to chain sinkListItem and wrapInList (move item into sublist if already in an item, otherwise create a new list)

1 Like