👨‍🔧 fix: recognize command+click on macos (#2786)

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.
This commit is contained in:
Elijah Shackelford 2024-05-19 02:44:14 -04:00 committed by GitHub
parent f0e8cca5df
commit af8bcb08d6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -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;
}

View file

@ -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');