I was stuck on video “6 - Adding a Dropdown Menu” in the Authentication section of the NextJS Project: Build an Issue Tracker series.
My problem is that clicking the Avatar does not trigger the DropDownMenu. When I change the Avatar to a simple Text it works.
I haven’t figured out how to make this work with the Avatar. Anyone else have this issue?
This works:
<DropdownMenu.Root>
<DropdownMenu.Trigger>
<Text size="2">{session.user.email}</Text>
</DropdownMenu.Trigger>
<DropdownMenu.Content>
<DropdownMenu.Item>
<Link href="/api/auth/signout">Sign Out</Link>
</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu.Root>
This doesn’t work:
<DropdownMenu.Root>
<DropdownMenu.Trigger>
<Avatar src={session.user.image}
fallback="?"
size="2"
radius="full"
className="cursor-pointer" />
</DropdownMenu.Trigger>
<DropdownMenu.Content>
<DropdownMenu.Label>
<Text size="2">{session.user.email}</Text>
</DropdownMenu.Label>
<DropdownMenu.Item>
<Link href="/api/auth/signout">Sign Out</Link>
</DropdownMenu.Item>
</DropdownMenu.Content>
</DropdownMenu.Root>