diff --git a/frontend/src/components/input/editor/TipTap.vue b/frontend/src/components/input/editor/TipTap.vue index 7f36fb75b..b343a1be6 100644 --- a/frontend/src/components/input/editor/TipTap.vue +++ b/frontend/src/components/input/editor/TipTap.vue @@ -182,6 +182,7 @@ import XButton from '@/components/input/Button.vue' import {isEditorContentEmpty} from '@/helpers/editorContentEmpty' import inputPrompt from '@/helpers/inputPrompt' import {setLinkInEditor} from '@/components/input/editor/setLinkInEditor' +import StopLinkOnSpace from './stopLinkOnSpace' const props = withDefaults(defineProps<{ modelValue: string, @@ -464,11 +465,12 @@ const extensions : Extensions = [ }, }), - Commands.configure({ - suggestion: suggestionSetup(t), - }), - - PasteHandler, + Commands.configure({ + suggestion: suggestionSetup(t), + }), + + PasteHandler, + StopLinkOnSpace, ] // Add a custom extension for the Escape key diff --git a/frontend/src/components/input/editor/stopLinkOnSpace.ts b/frontend/src/components/input/editor/stopLinkOnSpace.ts new file mode 100644 index 000000000..ea2608511 --- /dev/null +++ b/frontend/src/components/input/editor/stopLinkOnSpace.ts @@ -0,0 +1,16 @@ +import {Extension} from '@tiptap/core' + +export default Extension.create({ + name: 'stopLinkOnSpace', + + addKeyboardShortcuts() { + return { + Space: ({editor}) => { + if (editor.isActive('link')) { + editor.commands.unsetLink() + } + return false + }, + } + }, +})