[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

@ -64,11 +64,7 @@ export const LiteTextEditor = React.forwardRef<EditorRefApi, LiteTextEditorWrapp
}}
isSubmitting={isSubmitting}
showSubmitButton={showSubmitButton}
handleSubmit={() => {
if (isMutableRefObject<EditorRefApi>(ref)) {
rest.onEnterKeyPress?.(ref.current?.getHTML() ?? "");
}
}}
handleSubmit={(e) => rest.onEnterKeyPress?.(e)}
isCommentEmpty={isEmpty}
editorRef={isMutableRefObject<EditorRefApi>(ref) ? ref : null}
/>

View file

@ -12,7 +12,7 @@ import { cn } from "@/helpers/common.helper";
type Props = {
executeCommand: (commandKey: TEditorCommands) => void;
handleSubmit: () => void;
handleSubmit: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
isCommentEmpty: boolean;
isSubmitting: boolean;
showSubmitButton: boolean;

View file

@ -66,8 +66,8 @@ export const AddComment: React.FC<Props> = observer((props) => {
control={control}
render={({ field: { value, onChange } }) => (
<LiteTextEditor
onEnterKeyPress={() => {
if (currentUser) handleSubmit(onSubmit)();
onEnterKeyPress={(e) => {
if (currentUser) handleSubmit(onSubmit)(e);
}}
workspaceId={workspaceID?.toString() ?? ""}
workspaceSlug={workspaceSlug?.toString() ?? ""}

View file

@ -103,7 +103,7 @@ export const CommentCard: React.FC<Props> = observer((props) => {
<LiteTextEditor
workspaceId={workspaceID?.toString() ?? ""}
workspaceSlug={workspaceSlug?.toString() ?? ""}
onEnterKeyPress={() => handleSubmit(handleCommentUpdate)()}
onEnterKeyPress={handleSubmit(handleCommentUpdate)}
ref={editorRef}
id={comment.id}
initialValue={value}