diff --git a/web/src/lib/components/EmailAddressDisplay.svelte b/web/src/lib/components/EmailAddressDisplay.svelte index aa79f9e..0f62dd2 100644 --- a/web/src/lib/components/EmailAddressDisplay.svelte +++ b/web/src/lib/components/EmailAddressDisplay.svelte @@ -5,6 +5,7 @@ let { email }: Props = $props(); let copied = $state(false); + let inputElement: HTMLInputElement; async function copyToClipboard() { try { @@ -15,13 +16,26 @@ console.error("Failed to copy:", err); } } + + function handleFocus(event: FocusEvent) { + const target = event.target as HTMLInputElement; + target.select(); + copyToClipboard(); + } -
-
- {email} +
+
+
{#if copied} - + Copied to clipboard! {/if}