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 interfere in Menu.tsx

DiamondThreeeab4fd2b8f8b
diff --cc libs/components/editor-plugins/src/menu/command-menu/Menu.tsx
index 1cd22e48e2,11e8d665da..78b6ef5ddd
--- a/libs/components/editor-plugins/src/menu/command-menu/Menu.tsx
+++ b/libs/components/editor-plugins/src/menu/command-menu/Menu.tsx
@@@ -234,32 -239,28 +239,32 @@@ export const CommandMenu = ({ editor, h
return (
<div
style={{ zIndex: 1 }}
- onKeyUpCapture={handle_keyup}
+ onKeyUpCapture={handleKeyup}
ref={commandMenuContentRef}
>
- <MuiClickAwayListener onClickAway={handleClickAway}>
- <div>
- <CommandMenuContainer
- editor={editor}
- hooks={hooks}
- style={{
- ...commandMenuPosition,
- ...style,
- }}
- isShow={show}
- blockId={blockId}
- onSelected={handleSelected}
- onclose={handleClose}
- searchBlocks={searchBlocks}
- types={types}
- categories={categories}
- />
- </div>
- </MuiClickAwayListener>
+ {show ? (
- <MuiClickAwayListener onClickAway={handle_click_away}>
++ <MuiClickAwayListener onClickAway={handleClickAway}>
+ <div>
+ <CommandMenuContainer
+ editor={editor}
+ hooks={hooks}
+ style={{
+ ...commandMenuPosition,
+ ...style,
+ }}
+ isShow={show}
+ blockId={blockId}
- onSelected={handle_selected}
- onclose={handle_close}
- searchBlocks={search_blocks}
++ onSelected={handleSelected}
++ onclose={handleClose}
++ searchBlocks={searchBlocks}
+ types={types}
+ categories={categories}
+ />
+ </div>
+ </MuiClickAwayListener>
+ ) : (
+ <></>
+ )}
</div>
);
};