From 945186e81db3df17c61ce47941428670cbae2692 Mon Sep 17 00:00:00 2001 From: Lin Wang Date: Wed, 27 Dec 2023 17:05:42 +0800 Subject: [PATCH] feat: change to ctrlKey and open flyout Signed-off-by: Lin Wang --- public/chat_header_button.test.tsx | 2 +- public/chat_header_button.tsx | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/chat_header_button.test.tsx b/public/chat_header_button.test.tsx index 5db80eda..0717a79e 100644 --- a/public/chat_header_button.test.tsx +++ b/public/chat_header_button.test.tsx @@ -155,7 +155,7 @@ describe('', () => { key: '/', code: 'NumpadDivide', charCode: 111, - metaKey: true, + ctrlKey: true, }); expect(screen.getByLabelText('chat input')).toHaveFocus(); }); diff --git a/public/chat_header_button.tsx b/public/chat_header_button.tsx index c08c2e97..e4f83fbd 100644 --- a/public/chat_header_button.tsx +++ b/public/chat_header_button.tsx @@ -125,7 +125,7 @@ export const HeaderChatButton = (props: HeaderChatButtonProps) => { useEffect(() => { const onGlobalMouseUp = (e: KeyboardEvent) => { - if (e.metaKey && e.key === '/') { + if (e.ctrlKey && e.key === '/') { inputRef.current?.focus(); } }; @@ -170,11 +170,11 @@ export const HeaderChatButton = (props: HeaderChatButtonProps) => { ) : ( - ⌘ + / + Ctrl + / )}