Thanks, I missed that point, That works fine. It is selecting parentnode.
But actually I want to get out focus mode when click Esc button,
How about the Tab key?
I need to add a custom event when click Tab, so exactly, I want to add 4 spans when press Tab.
But for now, when I press Tab, it works with accessibility, which means it gets out focus in the editor.
But actually I want to get out focus mode when click Esc button, How about the Tab key? I need to add a custom event when click Tab, so exactly, I want to add 4 spans when press Tab. But for now, when I press Tab, it works with accessibility, which means it gets out focus in the editor.
ProseMirror, when executing a keypress, will check the plugins in the order they are initialized, and will stop on the first key-handler that returns true.
So if you want your custom key-handlers to execute first, move them:
plugins: [
keymap({
// These handlers should return true or false
"Esc": customEscHandler,
"Tab": customTabHandler,
})
keymap(buildKeymap(schema)),
keymap(baseKeymap),
history(),
placeholder(),
]