diff --git a/src/components/ClipboardButton/ClipboardButton.tsx b/src/components/ClipboardButton/ClipboardButton.tsx index f7c3d000eb..c30d42065e 100644 --- a/src/components/ClipboardButton/ClipboardButton.tsx +++ b/src/components/ClipboardButton/ClipboardButton.tsx @@ -111,13 +111,13 @@ export function ClipboardButton(props: ClipboardButtonProps) { const timerIdRef = React.useRef(); const [tooltipCloseDelay, setTooltipCloseDelay] = React.useState(undefined); - const [tooltipDisabled, setTooltipDisabled] = React.useState(false); + const [tooltipDisabled, setTooltipDisabled] = React.useState(false); React.useEffect(() => window.clearTimeout(timerIdRef.current), []); const handleCopy: OnCopyHandler = React.useCallback( - (...args) => { - onCopy?.(...args); + (text, result) => { + onCopy?.(text, result); setTooltipDisabled(false); setTooltipCloseDelay(timeout);