diff --git a/packages/client/src/tiptap/extensions/mind.ts b/packages/client/src/tiptap/extensions/mind.ts index 7466e537..6a4b9498 100644 --- a/packages/client/src/tiptap/extensions/mind.ts +++ b/packages/client/src/tiptap/extensions/mind.ts @@ -1,5 +1,6 @@ import { Node, mergeAttributes, nodeInputRule } from '@tiptap/core'; import { ReactNodeViewRenderer } from '@tiptap/react'; +import { Plugin, PluginKey } from 'prosemirror-state'; import { MindWrapper } from 'tiptap/wrappers/mind'; import { getDatasetAttribute } from 'tiptap/prose-utils'; @@ -125,4 +126,21 @@ export const Mind = Node.create({ }), ]; }, + + addProseMirrorPlugins() { + const { editor } = this; + + return [ + new Plugin({ + key: new PluginKey('mind'), + props: { + handleKeyDown(view, event) { + if (editor.isActive('mind')) { + return true; + } + }, + }, + }), + ]; + }, });