fix: editor focus handling on click events (#716)
This commit is contained in:
parent
a2188645b9
commit
f1660a5331
1 changed files with 9 additions and 4 deletions
|
|
@ -340,7 +340,12 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
}, [editor, props.isMainInput, historyLength, ignoreHighlightedCode]);
|
||||
|
||||
return (
|
||||
<InputBoxDiv className="cursor-text">
|
||||
<InputBoxDiv
|
||||
className="cursor-text"
|
||||
onClick={() => {
|
||||
editor && editor.commands.focus();
|
||||
}}
|
||||
>
|
||||
<EditorContent
|
||||
editor={editor}
|
||||
onFocus={() => {
|
||||
|
|
@ -352,6 +357,9 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
setInputFocused(false);
|
||||
}, 100);
|
||||
}}
|
||||
onClick={(event) => {
|
||||
event.stopPropagation();
|
||||
}}
|
||||
/>
|
||||
<InputToolbar
|
||||
hidden={!(inputFocused || props.isMainInput)}
|
||||
|
|
@ -364,9 +372,6 @@ function TipTapEditor(props: TipTapEditorProps) {
|
|||
onEnter={() => {
|
||||
onEnterRef.current(editor.getJSON());
|
||||
}}
|
||||
onClick={() => {
|
||||
editor.commands.focus("end");
|
||||
}}
|
||||
/>
|
||||
</InputBoxDiv>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue