How do I add a custom "type over" handler?

Hi there,

Marijn told me to write my own custom delete/backspace handler in Unexpected backspace/delete key handling in nested lists · Issue #1259 · ProseMirror/prosemirror · GitHub

I did that and it works great.

However, I wonder how can I handle “typing over” (pardon my terminology if it’s incorrect, by typing over I mean when you range-select a chunk of text and start typing a character, say “a”, your selected chunk should be replaced by “a”)?

Do I add every single key imaginable inside a keymap or is there a more elegant way instead?

Mad thanks!

See handleTextInput — you can check whether the range is non-empty to detect type-over.

Sorry, but what does trange mean?

Nothing. That should be ‘range’.

Thank you so much!! Consider this solved. :bowing_man: