From 42f23535099cd3f4fd76744129a47c05fcf9f4c1 Mon Sep 17 00:00:00 2001 From: Danny Avila <110412045+danny-avila@users.noreply.github.com> Date: Wed, 3 Jan 2024 19:34:41 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=A8=EF=B8=8F=20refactor:=20Open=20New?= =?UTF-8?q?=20Tab=20for=20Ctrl+Click=20or=20Button=20Combo=20in=20NewChat?= =?UTF-8?q?=20(#1484)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/src/components/Nav/NewChat.tsx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/client/src/components/Nav/NewChat.tsx b/client/src/components/Nav/NewChat.tsx index 873aab2e1c..b0ebb195dc 100644 --- a/client/src/components/Nav/NewChat.tsx +++ b/client/src/components/Nav/NewChat.tsx @@ -6,15 +6,19 @@ export default function NewChat({ toggleNav }: { toggleNav: () => void }) { const navigate = useOriginNavigate(); const localize = useLocalize(); - const clickHandler = () => { - newConvo(); - newConversation(); - navigate('new'); - toggleNav(); + const clickHandler = (event: React.MouseEvent) => { + if (event.button === 0 && !event.ctrlKey) { + event.preventDefault(); + newConvo(); + newConversation(); + navigate('new'); + toggleNav(); + } }; return (