A block's tool setting opens a modal (or any other new view outside of editorjs). Whenever the user hits backspace _or_ enter in the new view though, the block - which is still selected (.ce-block--selected) - gets deleted.
There is currently _no way_ to remove the selection from the block, when a tune was toggled/clicked.

https://codepen.io/natterstefan/pen/PoqLVJr?editors=0110
There is a enableLineBreaks setting, managing how blocks behave when enter is pressed. In the example it still looks like this is not working properly.
Same goes for backspace, but here we never reach this part of the code:
Because the block is still selected and results to true in this if.
Enable developers to unselect a block when a tune was toggled. Means, a new method is added to the blocks API (https://editorjs.io/api#blocks).
When the toggle is clicked, we remove the selected class from the block. This should help us to pass the if`s in the keydown handlers.
But this is kinda hacky IMHO.
keydown listener on the document (here)? Because there is another backspacePressed handler.Hi,
I'm having the same problem with an input element inside the block settings. I can't press the backspace key while editing it or the whole block get removed. As a proposal, there's not documentation available for how to manage other types of inputs (apart of buttons) in the block settings. Simple blocks doesn't require it, but more complex ones requires that type of settings.
This can be considered as a bug, because while block settings is opened we usually don't might want to remove the block.
Regards
Hi @m-alzam,
Wouldn't you mind if I assign you to this issue?
Most helpful comment
Hi @m-alzam,
Wouldn't you mind if I assign you to this issue?