From af8bcb08d65d20425c5a28ab825d57cff725ebf0 Mon Sep 17 00:00:00 2001 From: Elijah Shackelford Date: Sun, 19 May 2024 02:44:14 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=A8=E2=80=8D=F0=9F=94=A7=20fix:=20reco?= =?UTF-8?q?gnize=20command+click=20on=20macos=20(#2786)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes an issue where the "command+click" was not being recognized on MacOS. The desired behavior was working fine on Windows using "ctrl+click", but the MacOS equivalent was broken. This was preventing new tabs from opening while holding "command" (meta key) on MacOS and clicking. I verified this change fixes the issue by building locally and testing. --- client/src/components/Conversations/Convo.tsx | 2 +- client/src/components/Nav/NewChat.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Conversations/Convo.tsx b/client/src/components/Conversations/Convo.tsx index efb1cb95c..b9a9a4d3c 100644 --- a/client/src/components/Conversations/Convo.tsx +++ b/client/src/components/Conversations/Convo.tsx @@ -37,7 +37,7 @@ export default function Conversation({ conversation, retainView, toggleNav, isLa const [isPopoverActive, setIsPopoverActive] = useState(false); const clickHandler = async (event: React.MouseEvent) => { - if (event.button === 0 && event.ctrlKey) { + if (event.button === 0 && (event.ctrlKey || event.metaKey)) { toggleNav(); return; } diff --git a/client/src/components/Nav/NewChat.tsx b/client/src/components/Nav/NewChat.tsx index 19e99a662..f0d74cc7b 100644 --- a/client/src/components/Nav/NewChat.tsx +++ b/client/src/components/Nav/NewChat.tsx @@ -71,7 +71,7 @@ export default function NewChat({ const { conversation } = store.useCreateConversationAtom(index); const clickHandler = (event: React.MouseEvent) => { - if (event.button === 0 && !event.ctrlKey) { + if (event.button === 0 && !(event.ctrlKey || event.metaKey)) { event.preventDefault(); newConvo(); navigate('/c/new');