Only available as a keyboard shortcut at the moment. Applies to blocks that have a notion of depth – list items only at the moment.
This could be built as an example / extension, using the controls API, instead of something that’s built-in. It would be nice to have this as a demo directly in the repo though.
Here is how it would work roughly:
- Add button(s) in the toolbar using the
controls API.
- On click, retrieve the editor state with the
getEditorState prop of the control
- Check where the selection is (
editorState.getSelection())
- If it's in a block that's a list item, apply the right effect (indent / dedent) by incrementing/decrementing the block’s
depth.
Initially reported at springload/wagtaildraftail#49 by @tomdyson.
Only available as a keyboard shortcut at the moment. Applies to blocks that have a notion of depth – list items only at the moment.
This could be built as an example / extension, using the controls API, instead of something that’s built-in. It would be nice to have this as a demo directly in the repo though.
Here is how it would work roughly:
controlsAPI.getEditorStateprop of the controleditorState.getSelection())depth.Initially reported at springload/wagtaildraftail#49 by @tomdyson.