forked from github/plane
onSubmit on enterkey captured
This commit is contained in:
parent
2c804c8d6c
commit
b479718ece
@ -0,0 +1,14 @@
|
||||
import { Extension } from '@tiptap/core';
|
||||
|
||||
export const EnterKeyExtension = Extension.create({
|
||||
name: 'enterKey',
|
||||
|
||||
addKeyboardShortcuts() {
|
||||
return {
|
||||
'Enter': () => {
|
||||
console.log('Submit comment');
|
||||
return true;
|
||||
},
|
||||
}
|
||||
},
|
||||
});
|
@ -0,0 +1,5 @@
|
||||
import { EnterKeyExtension } from "./enter-key-extension";
|
||||
|
||||
export const LiteTextEditorExtensions = () => [
|
||||
EnterKeyExtension
|
||||
];
|
@ -2,6 +2,7 @@
|
||||
import * as React from 'react';
|
||||
import { EditorContainer, EditorContentWrapper, getEditorClassNames, useEditor } from '@plane/editor-core';
|
||||
import { FixedMenu } from './menus/fixed-menu';
|
||||
import { LiteTextEditorExtensions } from './extensions';
|
||||
|
||||
export type UploadImage = (file: File) => Promise<string>;
|
||||
export type DeleteImage = (assetUrlWithWorkspaceId: string) => Promise<any>;
|
||||
@ -67,6 +68,7 @@ const LiteTextEditor = ({
|
||||
uploadFile,
|
||||
deleteFile,
|
||||
forwardedRef,
|
||||
extensions: LiteTextEditorExtensions(),
|
||||
});
|
||||
|
||||
const editorClassNames = getEditorClassNames({ noBorder, borderOnFocus, customClassName });
|
||||
|
@ -3,7 +3,7 @@
|
||||
"include": [
|
||||
"src/**/*",
|
||||
"index.d.ts"
|
||||
],
|
||||
, "../lite-text-editor/src/ui/extensions/enter-key-extension.tsx" ],
|
||||
"exclude": [
|
||||
"dist",
|
||||
"build",
|
||||
|
Loading…
Reference in New Issue
Block a user