Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix clickaway error in page

DiamondThree928a90942a40
diff --git a/libs/components/editor-plugins/src/menu/command-menu/Menu.tsx b/libs/components/editor-plugins/src/menu/command-menu/Menu.tsx
index 3ab140f3bc..1cd22e48e2 100644
--- a/libs/components/editor-plugins/src/menu/command-menu/Menu.tsx
+++ b/libs/components/editor-plugins/src/menu/command-menu/Menu.tsx
@@ -237,25 +237,29 @@ export const CommandMenu = ({ editor, hooks, style }: CommandMenuProps) => {
onKeyUpCapture={handle_keyup}
ref={commandMenuContentRef}
>
- <MuiClickAwayListener onClickAway={handle_click_away}>
- <div>
- <CommandMenuContainer
- editor={editor}
- hooks={hooks}
- style={{
- ...commandMenuPosition,
- ...style,
- }}
- isShow={show}
- blockId={blockId}
- onSelected={handle_selected}
- onclose={handle_close}
- searchBlocks={search_blocks}
- types={types}
- categories={categories}
- />
- </div>
- </MuiClickAwayListener>
+ {show ? (
+ <MuiClickAwayListener onClickAway={handle_click_away}>
+ <div>
+ <CommandMenuContainer
+ editor={editor}
+ hooks={hooks}
+ style={{
+ ...commandMenuPosition,
+ ...style,
+ }}
+ isShow={show}
+ blockId={blockId}
+ onSelected={handle_selected}
+ onclose={handle_close}
+ searchBlocks={search_blocks}
+ types={types}
+ categories={categories}
+ />
+ </div>
+ </MuiClickAwayListener>
+ ) : (
+ <></>
+ )}
</div>
);
};