Skip to content

Commit 2e4109a

Browse files
authored
Prevent event bubbling on copy-to-clipboard clicks (#2893)
1 parent 8cc5b25 commit 2e4109a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/ui/lib/CopyToClipboard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ export const CopyToClipboard = ({
3535

3636
useTimeout(() => setHasCopied(false), hasCopied ? 2000 : null)
3737

38-
const handleCopy = () => {
38+
const handleCopy = (event: React.MouseEvent) => {
39+
event.stopPropagation()
3940
window.navigator.clipboard.writeText(text).then(() => {
4041
setHasCopied(true)
4142
})

0 commit comments

Comments
 (0)