diff --git a/client/ui/chat/Message.tsx b/client/ui/chat/Message.tsx index 6e4693b..79b531c 100644 --- a/client/ui/chat/Message.tsx +++ b/client/ui/chat/Message.tsx @@ -33,6 +33,9 @@ export default function Message({ userId, rawData, renderHTML, message, ...props const dropDownRef = React.useRef(null) const messageJsonDialogRef = React.useRef(null) + useEventListener(messageJsonDialogRef, 'click', (e) => { + e.stopPropagation() + }) const [isDropDownOpen, setDropDownOpen] = React.useState(false) @@ -116,7 +119,10 @@ export default function Message({ userId, rawData, renderHTML, message, ...props dangerouslySetInnerHTML={{ __html: renderHTML }} /> - e.stopPropagation()}> + { + e.stopPropagation() + setDropDownOpen(false) + }}> copyToClipboard($(dropDownRef.current as HTMLElement).find('#msg').text())}>複製文字 copyToClipboard(rawData)}>複製原文 messageJsonDialogRef.current.open = true}>查看詳情