`EditorView.inputHandler` for deletion events

Hello! It seems that the function I pass to EditorView.inputHandler.of is only called in the case of input events that insert some new text, but not for events that only delete text. For example, it is called for selecting a block of text and pressing a letter key, but not for selecting a block of text and pressing the delete key. Is there any way to react to and potentially prevent deletion events? Thank you!

inputHandler is called for changes read directly from the DOM. Backspace/delete are bound as keys, and just execute a command when run. You could bind your own key, or try to use a transaction filter.

1 Like