I’m using baseKeyMap of prosemirror-commands which handles pressing enter.
I try to implement mentions and when a dropdown of users appears I want to press enter to insert the selected user. So I tried to prevent the default enter handler for this specific case within a plugin but this doesn’t work. The default enter handler is always called.
return new Plugin({
props: {
handleKeyDown(view, event) {
if (event.keyCode === 13) {
// not working
event.preventDefault()
}
},
},
})
Is there any other way to do this?