From ca740c83ae7f72a75c7db90d2e137a7e9a032326 Mon Sep 17 00:00:00 2001 From: 864907600cc <8115912+ccloli@users.noreply.github.com> Date: Mon, 3 Jun 2024 15:57:58 +0800 Subject: [PATCH] fix: fix context menu error on macOS (#170) * fix: fix context menu error on macOS * fix: adjust context menu icon style --- packages/designer/src/components/context-menu.tsx | 7 ++++++- packages/ui/src/context-action.tsx | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/designer/src/components/context-menu.tsx b/packages/designer/src/components/context-menu.tsx index 2d4471a..beff2eb 100644 --- a/packages/designer/src/components/context-menu.tsx +++ b/packages/designer/src/components/context-menu.tsx @@ -12,7 +12,12 @@ const contextMenuStyle = css` } .ant-dropdown-menu-title-content { - padding-left: 20px; + padding-left: 22px; + } + + .ant-dropdown-menu-item-icon { + font-size: 14px; + width: 14px; } .ant-dropdown-menu-item-icon + .ant-dropdown-menu-title-content { diff --git a/packages/ui/src/context-action.tsx b/packages/ui/src/context-action.tsx index 43f3ef7..8d40ff7 100644 --- a/packages/ui/src/context-action.tsx +++ b/packages/ui/src/context-action.tsx @@ -66,7 +66,7 @@ export function ContextAction({ option: 'Alt', shift: 'Shift', }; - const regexp = new RegExp(Object.keys(keyMap).join('|').replace(/\\+/, '\\+'), 'ig'); + const regexp = new RegExp(Object.keys(keyMap).join('|').replace(/\+/, '\\+'), 'ig'); return hotkey.replace(regexp, (match) => keyMap[match.toLowerCase()]); }, [hotkey]);