How to avoid deleting a list item if it will be the last item in the list? #5739
Unanswered
CharlieBrownCharacter
asked this question in
Questions & Help
Replies: 1 comment
-
Using https://prosemirror.net/docs/ref/#state.PluginSpec.appendTransaction |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello everyone 👋
I have an app that has several blocks and one of these blocks is a list type. The list type can only contain list items inside it. I'm trying to check if when
Backspace
is pressed the list will be empty and deleting such block.The pseudo-code that I'm looking for is:
Backspace
was pressedI was able to do such thing using extension's
addKeyboardShortcuts
:The problem is that the user can
CTRL+A
and then pressBackspace
, deleting everything. How can I detect this situation and ALWAYS leave at least one list item?Beta Was this translation helpful? Give feedback.
All reactions