I have an electron app using ProseMirror. The ProseMirror state is part of a larger redux state, and as such I’m handling undo-redo at a higher level than ProseMirror. I have a menu item that is supposed to trigger undo, and it’s bound to command+z (on mac).
The problem I’m facing is that when ProseMirror has focus, it explicitly prevents command+z from propagating out of the control. The interaction of captureKeyDown()
and editHandlers.keydown
in prosemirror-view
ends up calling preventDefault
on the relevant keydown events, and this seems to mean that the menu won’t get triggered by these events.
Is there a supported way to instruct ProseMirror to not swallow these events?
If not, is there some way to know that they happened at all? Or am I just approaching this problem in the wrong way? Is there some canonical way to manage un/redo “above” prosemirror?