fix: issue description placeholder (#4312)

This commit is contained in:
Aaryan Khandelwal 2024-04-30 17:21:52 +05:30 committed by GitHub
parent 87a606446f
commit 4f4f1d92e8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 28 additions and 30 deletions

View file

@ -34,7 +34,7 @@ interface CustomEditorProps {
suggestions?: () => Promise<IMentionSuggestion[]>;
};
handleEditorReady?: (value: boolean) => void;
placeholder?: string | ((isFocused: boolean) => string);
placeholder?: string | ((isFocused: boolean, value: string) => string);
tabIndex?: number;
}

View file

@ -43,7 +43,7 @@ type TArguments = {
cancelUploadImage?: () => void;
uploadFile: UploadImage;
};
placeholder?: string | ((isFocused: boolean) => string);
placeholder?: string | ((isFocused: boolean, value: string) => string);
tabIndex?: number;
};
@ -147,7 +147,7 @@ export const CoreEditorExtensions = ({
if (placeholder) {
if (typeof placeholder === "string") return placeholder;
else return placeholder(editor.isFocused);
else return placeholder(editor.isFocused, editor.getHTML());
}
return "Press '/' for commands...";

View file

@ -31,7 +31,7 @@ interface IDocumentEditor {
suggestions: () => Promise<IMentionSuggestion[]>;
};
tabIndex?: number;
placeholder?: string | ((isFocused: boolean) => string);
placeholder?: string | ((isFocused: boolean, value: string) => string);
}
const DocumentEditor = (props: IDocumentEditor) => {

View file

@ -32,7 +32,7 @@ export interface ILiteTextEditor {
suggestions?: () => Promise<IMentionSuggestion[]>;
};
tabIndex?: number;
placeholder?: string | ((isFocused: boolean) => string);
placeholder?: string | ((isFocused: boolean, value: string) => string);
}
const LiteTextEditor = (props: ILiteTextEditor) => {

View file

@ -35,7 +35,7 @@ export type IRichTextEditor = {
highlights: () => Promise<IMentionHighlight[]>;
suggestions: () => Promise<IMentionSuggestion[]>;
};
placeholder?: string | ((isFocused: boolean) => string);
placeholder?: string | ((isFocused: boolean, value: string) => string);
tabIndex?: number;
};