From b3aff5e9b542f9f47a87281cfd4d18c05b605798 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E6=B2=9B=E9=BA=9F?= Date: Sat, 10 Aug 2024 11:39:46 +0800 Subject: [PATCH 1/3] feat: table-not-insert-table --- .../plugins/ComponentPickerPlugin/index.tsx | 11 +++++-- .../src/plugins/ToolbarPlugin/index.tsx | 31 +++++++++++-------- .../src/LexicalTypeaheadMenuPlugin.tsx | 25 +++++++++++++-- packages/lexical/src/index.ts | 1 + 4 files changed, 50 insertions(+), 18 deletions(-) diff --git a/packages/lexical-playground/src/plugins/ComponentPickerPlugin/index.tsx b/packages/lexical-playground/src/plugins/ComponentPickerPlugin/index.tsx index 19406089056..f3e49b17ee0 100644 --- a/packages/lexical-playground/src/plugins/ComponentPickerPlugin/index.tsx +++ b/packages/lexical-playground/src/plugins/ComponentPickerPlugin/index.tsx @@ -367,13 +367,18 @@ export default function ComponentPickerMenuPlugin(): JSX.Element { options={options} menuRenderFn={( anchorElementRef, - {selectedIndex, selectOptionAndCleanUp, setHighlightedIndex}, + { + selectedIndex, + selectOptionAndCleanUp, + setHighlightedIndex, + options: menuOptions, + }, ) => - anchorElementRef.current && options.length + anchorElementRef.current && menuOptions.length ? ReactDOM.createPortal(