fix: use correct CustomEvent for email copying
This commit is contained in:
@@ -379,7 +379,7 @@
|
||||
in:fly={{ y: 4, duration: 325, easing: quartOutSvelte, delay: 250 }}
|
||||
out:fade={{ duration: 250, easing: quartOutSvelte }}
|
||||
use:mailtoClipboard
|
||||
oncopied={(email: string) => {
|
||||
oncopied={({ detail: email }: CustomEvent<string>) => {
|
||||
emailCopied = email
|
||||
// Clear timeout and add timeout to hide message
|
||||
clearTimeout(emailCopiedTimeout)
|
||||
|
||||
@@ -14,7 +14,7 @@ export const mailtoClipboard = (node: HTMLElement) => {
|
||||
navigator.clipboard.writeText(emailAddress)
|
||||
|
||||
// Send event
|
||||
node.dispatchEvent(new CustomEvent('copied', emailAddress))
|
||||
node.dispatchEvent(new CustomEvent('copied', { detail: emailAddress }))
|
||||
|
||||
// Record event in analytics
|
||||
sendEvent('emailCopy')
|
||||
|
||||
Reference in New Issue
Block a user