[WEB-2233] fix: intake issue comment (#5368)

* fix: intake issue comment

* chore: issue comment improvement
This commit is contained in:
Anmol Singh Bhatia 2024-08-14 19:38:37 +05:30 committed by GitHub
parent 4a71eef72e
commit 3e83eed398
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 34 additions and 32 deletions

View file

@ -1,6 +1,6 @@
import { Extension } from "@tiptap/core";
export const EnterKeyExtension = (onEnterKeyPress?: (descriptionHTML: string) => void) =>
export const EnterKeyExtension = (onEnterKeyPress?: () => void) =>
Extension.create({
name: "enterKey",
@ -8,7 +8,9 @@ export const EnterKeyExtension = (onEnterKeyPress?: (descriptionHTML: string) =>
return {
Enter: () => {
if (!this.editor.storage.mentionsOpen) {
onEnterKeyPress?.(this.editor.getHTML());
if (onEnterKeyPress) {
onEnterKeyPress();
}
return true;
}
return false;

View file

@ -35,7 +35,7 @@ export interface IEditorProps {
suggestions?: () => Promise<IMentionSuggestion[]>;
};
onChange?: (json: object, html: string) => void;
onEnterKeyPress?: (descriptionHTML: string) => void;
onEnterKeyPress?: (e?: any) => void;
placeholder?: string | ((isFocused: boolean, value: string) => string);
tabIndex?: number;
value?: string | null;