fix: open the contact card in place instead of sliding in from the top left

This commit is contained in:
Linus Rath
2026-10-21 16:54:29 +02:00
parent 80323148d2
commit 68047e7fdb
2 changed files with 12 additions and 1 deletions
@@ -75,3 +75,14 @@ describe('RecipientCardPopover', () => {
expect(onClose).toHaveBeenCalledTimes(3);
});
});
describe('recipient card styling', () => {
// A bare `duration-*` sets transition-duration, and with no
// transition-property that means `all`: the card slid from the top left
// corner to its anchor instead of appearing there.
it('times only the enter animation, not a transition on its position', () => {
render(<RecipientCardPopover anchor={{ top: 10, bottom: 30, left: 10 }} email={address} onClose={() => {}} />);
const classes = screen.getByRole('dialog').className.split(/\s+/);
expect(classes.filter((c) => /^duration-/.test(c))).toEqual([]);
});
});
+1 -1
View File
@@ -184,7 +184,7 @@ export function placeCard(anchor: CardAnchor, height: number): { top: number; le
}
export const recipientCardClass =
"fixed z-50 w-[300px] max-w-[calc(100vw-16px)] bg-background rounded-lg shadow-lg border border-border animate-in fade-in-0 zoom-in-95 duration-100";
"fixed z-50 w-[300px] max-w-[calc(100vw-16px)] bg-background rounded-lg shadow-lg border border-border animate-in fade-in-0 zoom-in-95 animation-duration-100";
interface RecipientCardPopoverProps extends RecipientCardProps {
anchor: CardAnchor;