Skip to content

Commit

Permalink
πŸ‘¨β€πŸ”§ fix: recognize command+click on macos (danny-avila#2786)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
eshack94 authored and techwithanirudh committed May 20, 2024
1 parent fd51791 commit 6984a62
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion client/src/components/Conversations/Convo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function Conversation({ conversation, retainView, toggleNav, isLa
const [isPopoverActive, setIsPopoverActive] = useState(false);

const clickHandler = async (event: React.MouseEvent<HTMLAnchorElement>) => {
if (event.button === 0 && event.ctrlKey) {
if (event.button === 0 && (event.ctrlKey || event.metaKey)) {
toggleNav();
return;
}
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/Nav/NewChat.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export default function NewChat({
const { conversation } = store.useCreateConversationAtom(index);

const clickHandler = (event: React.MouseEvent<HTMLAnchorElement>) => {
if (event.button === 0 && !event.ctrlKey) {
if (event.button === 0 && !(event.ctrlKey || event.metaKey)) {
event.preventDefault();
newConvo();
navigate('/c/new');
Expand Down

0 comments on commit 6984a62

Please sign in to comment.