From ef62eb7ebbb13b71635f77ea7e4bf72f3dc46af3 Mon Sep 17 00:00:00 2001 From: ChenX Date: Wed, 2 Jun 2021 17:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=E6=89=93=E5=BC=80=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E6=97=B6,?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=BB=9A=E5=8A=A8=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Editor/GetKeyWordService.tsx | 2 +- src/UI/Components/ContextMenu/KeyWordContextMenu.tsx | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Editor/GetKeyWordService.tsx b/src/Editor/GetKeyWordService.tsx index 48a104bc8..fd1cf9e80 100644 --- a/src/Editor/GetKeyWordService.tsx +++ b/src/Editor/GetKeyWordService.tsx @@ -66,7 +66,7 @@ export class GetKeyWordsServices implements EditorService //更新上下文菜单的位置 private UpdateContextMenuPosition() { - let menuHeight = this.keywordList.length * MENU_ITEM_HEIGHT + MENU_PADDING; + let menuHeight = Math.min(window.innerHeight, this.keywordList.length * MENU_ITEM_HEIGHT + MENU_PADDING); if (this.ed.MouseCtrl._CurMousePointClient.y > window.innerHeight - menuHeight) this.mousePositionY = this.ed.MouseCtrl._CurMousePointClient.y - menuHeight; diff --git a/src/UI/Components/ContextMenu/KeyWordContextMenu.tsx b/src/UI/Components/ContextMenu/KeyWordContextMenu.tsx index 6588a7e3e..5633272eb 100644 --- a/src/UI/Components/ContextMenu/KeyWordContextMenu.tsx +++ b/src/UI/Components/ContextMenu/KeyWordContextMenu.tsx @@ -28,6 +28,8 @@ export class KeyWordContextMenu extends React.Component<{ keywordStore?: GetKeyW top: `${store.mousePositionY}px`, cursor: "default", zIndex: parseFloat(ZINDEX.RightMenu), + maxHeight: "100%", + overflow: "auto" } } onMouseLeave={() => { this.props.keywordStore.m_ShowChildrenIndex = -1; }}