- {modalType === "invitation"
- ? "Copy and send the generated link to onboard this user to the proxy."
- : "Copy and send the generated link to the user to reset their password."}
-
-
-
toast.success("Copied!")}>
-
-
+
+
+
User ID
+
{invitationLinkData?.user_id}
+
+
+
+
+
+
+ copyToClipboard(invitationUrl)}
+ >
+
+ Copy
+
+
+
+
diff --git a/ui/litellm-dashboard/src/utils/dataUtils.ts b/ui/litellm-dashboard/src/utils/dataUtils.ts
index 8908041a626..c813a69b999 100644
--- a/ui/litellm-dashboard/src/utils/dataUtils.ts
+++ b/ui/litellm-dashboard/src/utils/dataUtils.ts
@@ -92,6 +92,7 @@ export const copyToClipboard = async (
// Fallback method using document.execCommand (deprecated but widely supported)
const fallbackCopyToClipboard = (text: string, messageText: string): boolean => {
try {
+ const previouslyFocused = document.activeElement;
const textArea = document.createElement("textarea");
textArea.value = text;
@@ -107,6 +108,7 @@ const fallbackCopyToClipboard = (text: string, messageText: string): boolean =>
const successful = document.execCommand("copy");
document.body.removeChild(textArea);
+ if (previouslyFocused instanceof HTMLElement) previouslyFocused.focus();
if (successful) {
toast.success(messageText);