Commit b780fbd6 by heheer Committed by GitHub

fix lexical editor space (#3586)

* fix lexical editor space

* delete console
parent 78612293
...@@ -31,7 +31,7 @@ const HttpInput = ({ ...@@ -31,7 +31,7 @@ const HttpInput = ({
const onChangeInput = useCallback( const onChangeInput = useCallback(
(editorState: EditorState, editor: LexicalEditor) => { (editorState: EditorState, editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{'); const text = editorStateToText(editor);
setCurrentValue(text); setCurrentValue(text);
onChange?.(text); onChange?.(text);
}, },
...@@ -39,7 +39,7 @@ const HttpInput = ({ ...@@ -39,7 +39,7 @@ const HttpInput = ({
); );
const onBlurInput = useCallback( const onBlurInput = useCallback(
(editor: LexicalEditor) => { (editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{'); const text = editorStateToText(editor);
onBlur?.(text); onBlur?.(text);
}, },
[onBlur] [onBlur]
......
...@@ -40,14 +40,14 @@ const PromptEditor = ({ ...@@ -40,14 +40,14 @@ const PromptEditor = ({
const onChangeInput = useCallback( const onChangeInput = useCallback(
(editorState: EditorState, editor: LexicalEditor) => { (editorState: EditorState, editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{'); const text = editorStateToText(editor);
onChange?.(text); onChange?.(text);
}, },
[onChange] [onChange]
); );
const onBlurInput = useCallback( const onBlurInput = useCallback(
(editor: LexicalEditor) => { (editor: LexicalEditor) => {
const text = editorStateToText(editor).replaceAll('}}{{', '}} {{'); const text = editorStateToText(editor);
onBlur?.(text); onBlur?.(text);
}, },
[onBlur] [onBlur]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment