mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
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
This commit is contained in:
@@ -22,7 +22,7 @@ export const CopyButton: FC<CopyButtonProps> = ({
|
||||
const { showCopiedSuccess, copyToClipboard } = useClipboard();
|
||||
|
||||
return (
|
||||
<TooltipProvider>
|
||||
<TooltipProvider delayDuration={100}>
|
||||
<Tooltip>
|
||||
<TooltipTrigger asChild>
|
||||
<Button
|
||||
|
||||
@@ -35,6 +35,7 @@ export const UserDropdown: FC<UserDropdownProps> = ({
|
||||
<PopoverContent
|
||||
align="end"
|
||||
className="min-w-auto w-[260px] bg-surface-secondary border-surface-quaternary"
|
||||
onOpenAutoFocus={(e) => e.preventDefault()}
|
||||
>
|
||||
<UserDropdownContent
|
||||
user={user}
|
||||
|
||||
Reference in New Issue
Block a user