Skip to content

Commit ad59277

Browse files
authored
fix: Fix not being able to move the cursor on click on the message editor (#376)
1 parent 33246b7 commit ad59277

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

apps/array/src/renderer/features/message-editor/components/MessageEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export const MessageEditor = forwardRef<EditorHandle, MessageEditorProps>(
8484

8585
const handleContainerClick = (e: React.MouseEvent) => {
8686
const target = e.target as HTMLElement;
87-
if (!target.closest("button")) {
87+
if (!target.closest("button") && !target.closest(".ProseMirror")) {
8888
focus();
8989
}
9090
};

apps/array/src/renderer/features/task-detail/components/TaskInputEditor.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,12 @@ export const TaskInputEditor = forwardRef<
111111
overflow: "visible",
112112
zIndex: 1,
113113
}}
114-
onClick={() => focus()}
114+
onClick={(e) => {
115+
const target = e.target as HTMLElement;
116+
if (!target.closest(".ProseMirror")) {
117+
focus();
118+
}
119+
}}
115120
>
116121
<Flex
117122
align="start"

0 commit comments

Comments
 (0)