fix: toggle recipient popover when clicking name again

This commit is contained in:
Linus Rath
2026-05-17 23:45:57 +02:00
parent 1f47b7a6a9
commit be5ff96e4d
+6 -2
View File
@@ -39,7 +39,11 @@ export function RecipientPopover({ name, email, displayLabel, onViewContact, cla
const phones = contact?.phones ? Object.values(contact.phones) : [];
const orgs = contact?.organizations ? Object.values(contact.organizations) : [];
const handleOpen = () => {
const handleToggle = () => {
if (isOpen) {
handleClose();
return;
}
if (!triggerRef.current) return;
const rect = triggerRef.current.getBoundingClientRect();
const popoverWidth = 300;
@@ -125,7 +129,7 @@ export function RecipientPopover({ name, email, displayLabel, onViewContact, cla
<>
<button
ref={triggerRef}
onClick={handleOpen}
onClick={handleToggle}
className={cn(
"text-foreground hover:text-primary hover:underline cursor-pointer transition-colors min-w-0 break-words",
className