Scheduling infrastructure for absolutely everyone.
Fix: about section editor (#7287)
Arindam Biswasc374f4fa200b
diff --git a/packages/ui/components/editor/Editor.tsx b/packages/ui/components/editor/Editor.tsxindex d66cdeeb961..cd2ffec8ee1 100644--- a/packages/ui/components/editor/Editor.tsx+++ b/packages/ui/components/editor/Editor.tsx@@ -2,7 +2,6 @@ import { CodeHighlightNode, CodeNode } from "@lexical/code";import { AutoLinkNode, LinkNode } from "@lexical/link";import { ListItemNode, ListNode } from "@lexical/list";import { TRANSFORMERS } from "@lexical/markdown";-import { AutoFocusPlugin } from "@lexical/react/LexicalAutoFocusPlugin";import { LexicalComposer } from "@lexical/react/LexicalComposer";import { ContentEditable } from "@lexical/react/LexicalContentEditable";import { LinkPlugin } from "@lexical/react/LexicalLinkPlugin";@@ -71,7 +70,6 @@ export const Editor = (props: TextEditorProps) => {contentEditable={<ContentEditable style={{ height: props.height }} className="editor-input" />}placeholder={<div className="-mt-11 p-3 text-sm text-gray-300">{props.placeholder || ""}</div>}/>- <AutoFocusPlugin /><ListPlugin /><LinkPlugin /><AutoLinkPlugin />diff --git a/packages/ui/components/editor/plugins/ToolbarPlugin.tsx b/packages/ui/components/editor/plugins/ToolbarPlugin.tsxindex d265e858c97..1c4fe0eb9b3 100644--- a/packages/ui/components/editor/plugins/ToolbarPlugin.tsx+++ b/packages/ui/components/editor/plugins/ToolbarPlugin.tsx@@ -349,11 +349,12 @@ export default function ToolbarPlugin(props: TextEditorProps) {$getRoot().select();$insertNodes(nodes);- editor.registerUpdateListener(({ editorState }) => {+ editor.registerUpdateListener(({ editorState, prevEditorState }) => {editorState.read(() => {const textInHtml = $generateHtmlFromNodes(editor);props.setText(textInHtml);});+ if (!prevEditorState._selection) editor.blur();});});}, []);