From 8bbffb6a88d2941275e4b6b430d813f4ad66bf03 Mon Sep 17 00:00:00 2001 From: fmtabbara Date: Fri, 29 Apr 2022 10:45:43 +0100 Subject: [PATCH] prevent bubbling --- .../src/components/clipboard/CopyToClipboard.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ts-packages/react-components/src/components/clipboard/CopyToClipboard.tsx b/ts-packages/react-components/src/components/clipboard/CopyToClipboard.tsx index 344241e566..2bcc6852fc 100644 --- a/ts-packages/react-components/src/components/clipboard/CopyToClipboard.tsx +++ b/ts-packages/react-components/src/components/clipboard/CopyToClipboard.tsx @@ -13,7 +13,8 @@ export const CopyToClipboard: React.FC<{ }> = ({ value, tooltip, onCopy, sx }) => { const copy = useClipboard(); const [showConfirmation, setShowConfirmation] = React.useState(false); - const handleCopy = () => { + const handleCopy = (e: React.MouseEvent) => { + e.stopPropagation(); setShowConfirmation(true); copy.copy(value); if (onCopy) {