Skip to content

Commit c2319e5

Browse files
authored
fix: prevent tooltip appearing on dropdown open (#20765)
The tooltip inside CopyButton inside Userdropdown is appearing automatically when the dropdown is opened. This feels a bit janky and the goal of this fix is to only show the tooltip content when the user hovers the copy button. https://github.com/user-attachments/assets/2e41da8d-08c5-476b-b0fc-a40d4f8e3d6c
1 parent 0cd33d1 commit c2319e5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

site/src/components/CopyButton/CopyButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export const CopyButton: FC<CopyButtonProps> = ({
2222
const { showCopiedSuccess, copyToClipboard } = useClipboard();
2323

2424
return (
25-
<TooltipProvider>
25+
<TooltipProvider delayDuration={100}>
2626
<Tooltip>
2727
<TooltipTrigger asChild>
2828
<Button

site/src/modules/dashboard/Navbar/UserDropdown/UserDropdown.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ export const UserDropdown: FC<UserDropdownProps> = ({
3535
<PopoverContent
3636
align="end"
3737
className="min-w-auto w-[260px] bg-surface-secondary border-surface-quaternary"
38+
onOpenAutoFocus={(e) => e.preventDefault()}
3839
>
3940
<UserDropdownContent
4041
user={user}

0 commit comments

Comments
 (0)