fix lexical editor space (#3586)

* fix lexical editor space

* delete console
This commit is contained in:
heheer
2025-01-14 17:24:16 +08:00
committed by GitHub
parent 7861229325
commit b780fbd6a7
2 changed files with 4 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ const HttpInput = ({
const onChangeInput = useCallback(
(editorState: EditorState, editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
const text = editorStateToText(editor);
setCurrentValue(text);
onChange?.(text);
},
@@ -39,7 +39,7 @@ const HttpInput = ({
);
const onBlurInput = useCallback(
(editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
const text = editorStateToText(editor);
onBlur?.(text);
},
[onBlur]

View File

@@ -40,14 +40,14 @@ const PromptEditor = ({
const onChangeInput = useCallback(
(editorState: EditorState, editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
const text = editorStateToText(editor);
onChange?.(text);
},
[onChange]
);
const onBlurInput = useCallback(
(editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{');
const text = editorStateToText(editor);
onBlur?.(text);
},
[onBlur]