From 9b8b27bab0b457204a9384825ddcf57ab31c2890 Mon Sep 17 00:00:00 2001 From: Baptiste Arnaud Date: Tue, 14 Jun 2022 10:00:05 +0200 Subject: [PATCH] =?UTF-8?q?perf:=20=F0=9F=9A=B8=20Make=20guest=20bubble=20?= =?UTF-8?q?selectable?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ChatGroup/ChatBlock/bubbles/GuestBubble.tsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/packages/bot-engine/src/components/ChatGroup/ChatBlock/bubbles/GuestBubble.tsx b/packages/bot-engine/src/components/ChatGroup/ChatBlock/bubbles/GuestBubble.tsx index f20664733..5b1533a95 100644 --- a/packages/bot-engine/src/components/ChatGroup/ChatBlock/bubbles/GuestBubble.tsx +++ b/packages/bot-engine/src/components/ChatGroup/ChatBlock/bubbles/GuestBubble.tsx @@ -16,16 +16,27 @@ export const GuestBubble = ({ onClick, }: Props): JSX.Element => { const [content] = useState(message) + const [isDragging, setIsDragging] = useState(false) + + const handleMouseDown = () => setIsDragging(false) + const handleMouseMove = () => setIsDragging(true) + const handleMouseUp = () => { + setIsDragging(false) + if (isDragging) return + onClick() + } return (
{content}