[WEB-2233] fix: intake issue comment (#5368)
* fix: intake issue comment * chore: issue comment improvement
This commit is contained in:
parent
4a71eef72e
commit
3e83eed398
9 changed files with 34 additions and 32 deletions
|
|
@ -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}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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() ?? ""}
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue